Name DataType Subtype Length Laut Automation 'Windows Script Host Object Model'.WshShell Lint Integer
DosShell(ItxtCommand : Text[1024];IintWindowStyle : Integer;IblnWaitForEndOfCommand : Boolean) OintReturnValue : Integer // DosShell //*** 109 // Works like SHELL and HYPERLINK of Navision but without the annoying confirmation-request of Navision 4.00 // (this function uses automation 'Windows Script Host Object Model'.WshShell) // PARAMETERS: // ItxtCommand : command + parameters for the SHELL // IintWindowStyle : Type of window for command // 0:Hides the window and activates another window. (=Doesn't even show a window, to kill the doscommand, // you have to do it with taskmanager=>Processes) // 1:Activates and displays a window. If the window is minimized or maximized, the system restores // it to its original size and position. An application should specify this flag when displaying // the window for the first time. (=shows the window as normal window) // 2:Activates the window and displays it as a minimized window. (=shows as minimized) // 3:Activates the window and displays it as a maximized window. (=shows as maximized) // 4:Displays a window in its most recent size and position. The active window remains active. // 5:Activates the window and displays it in its current size and position. // 6:Minimizes the specified window and activates the next top-level window in the Z order. // 7:Displays the window as a minimized window. The active window remains active. // 8:Displays the window in its current state. The active window remains active. // 9:Activates and displays the window. If the window is minimized or maximized, the system // restores it to its original size and position. An application should specify this flag // when restoring a minimized window. // 10:Sets the show-state based on the state of the program that started the application. // IblnWaitForEndOfCommand : TRUE : wait for the command to finish (and use the RETURN-VALUE) // FALSE: Launch the command and return (RETURN-VALUE will be 0) // RETURN-VALUE : SHELL-command RETURN-VALUE CREATE(Laut); OintReturnValue := Laut.Run(ItxtCommand,IintWindowStyle,IblnWaitForEndOfCommand); CLEAR(Laut);
Comments
Regards
Can you please let me know from where I will call this function?
Regards
Mini
you can call this from every where in Navision. But this function is not a Navision function, it's customized.
So, you must create this "example function" self. Also you need the "Windows Scription Host" as Variable (if you need more infos about these theme, search the forum for Windows Scripting Host or WSH)
To understand this example, create, only for this example, a blank form with a button.
In the form you create the Kriki's function with the needed WSH variable. From your button you call the function like
Now, Notepad is opend (as example)
Regards
Any ideas, please?
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I am trying to send some text file with label to printer connected via USB port (USB is mapped to LPT 1 in windows)
I am using this code:
IF ISCLEAR(autWinScriptHost) THEN
CREATE(autWinScriptHost);
txtCommand := 'copy /B ' + txtFilename+ ' LPT1';
autWinScriptHost.Run(txtCommand);
where txtfilename is d:\Navision\ProTeam\geis\PDL1208283.txt
attached error appears
there are no spaces in file path.
Please, can you tell me, what can be wrong? Thanks in advance.
Which version of NAV are you using?
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
from commandline it works (I copied value of txtcommand from debugger and inserted it to commandline)
Copy is not an executable but is part of the cmd.exe. So you need to run that for copying the file:
"cmd.exe /C copy ...."
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Thank you very much.
I use this to do ftp transfers with an ftp commandline tool. works pretty good.
I use the "IblnWaitForEndOfCommand = true" Option. And mostly the returnvalue is 0, which is OK.
But sometimes I get "3" as returnvalue, and I don't know what that means, and I can not find information about the different returnvalues