|
Post by Tom Steuver on Jun 16, 2020 9:52:04 GMT -5
In my program (LB v4.5.1) I am creating a BAT file that allows me to logoff a session from a remote server. The command is "logoff /server:name #" where # is the session id. I can run the BAT file from command prompt just fine. When I use it in a run command in LB, it just flashes and doesn't run. What am I doing wrong here?
open "c:\RDS\rdsscript.bat" for output as #outfile
print #outfile,"logoff /server:";sserver$;" ";inid$
close #outfile
run "c:\RDS\rdsscript.bat",show
|
|
|
Post by metro on Jun 16, 2020 10:56:06 GMT -5
|
|
|
Post by Chris Iverson on Jun 16, 2020 11:38:23 GMT -5
Does it flash a black command prompt window for a second, and then close?
Because that's what's supposed to happen. If you run a batch file, once the batch file is done executing, the command window closes(unless you used an interactive console to launch the batch file, then it goes back to the prompt).
Is it still logging off the session?
Because the batch file should be running.
If you don't want the command prompt to close after executing the batch file, then you need to add a PAUSE command to the end of the batch file(which will pause until the user hits enter, at which point the prompt will close)
|
|
|
Post by Rod on Jun 16, 2020 15:00:46 GMT -5
print the output to the mainwin with a simple print command to be sure what you are writing to the .bat file is exactly what you type in at the command prompt. Or just open the .bat file with notepad to check.
|
|