View Full Version : Running a DOS command and keeping the window open
ray.lucas
2005-05-24, 01:53 AM
Need a little help in keeping a DOS windows open while running a DOS command. The command to run is "nbtstat -a {computer ip address}" this returns the computers name.
Very handy command in DOS to find the computer name and user that is logged onto that machine.
(command "shell" "ndtstate -a 10.10.10.10") flashes up but closes once run.
(command "shell" "command" "ndtstate -a 10.10.10.10") opens the shell but nothing else
(command "shell" "command ndtstate -a 10.10.10.10") to many arguments.
If your not on a network just subsitiute something simple, "dir" just need to be able to run a command and keep the window open in LISP.
kennet.sjoberg
2005-05-24, 08:13 AM
Need a little help in keeping a DOS windows open. . .
type shell
then type command
do dir or whatever
type exit
but as lisp, I do not know.
: ) Happy Computing !
kennet
kennet.sjoberg
2005-05-24, 09:56 AM
Try to go via a temp file
(command "shell" "nbtstat -a 10.10.10.10 > c:$$temp$$.tmp" )
(startapp "notepad" "c:$$temp$$.tmp" )
: ) Happy Computing !
kennet
bsteele
2005-05-24, 07:47 PM
Add a "" after "shell" ie:
(COMMAND "SHELL" "" "DIR" "*.*")
kennet.sjoberg
2005-05-24, 08:45 PM
Add a "" after "shell" ie:
Nope, that will not keep the "dir" window open after dir, the task.
: ) Happy Computing !
kennet
Ed Jobe
2005-05-24, 09:09 PM
The pgp has options for keeping the window open.
kennet.sjoberg
2005-05-24, 09:23 PM
The pgp has options for keeping the window open.
..hmm, I suppose the IP number in nbtstat will be dynamic. Not one pgp row for each.
BTW, have You tried the pgp ?
: ) Happy Computing !
kennet
bsteele
2005-05-24, 09:26 PM
And it won't work at all wrapped into a Defun expression.......sorry.
jwanstaett
2005-05-24, 10:09 PM
open notepad
type in
nbtstat -a %1
pause
save as mynbtstat.bat
use this code in your list
(command "shell" "mynbtstat.bat 10.10.10.10" )
ray.lucas
2005-05-25, 01:35 AM
Thanks for all the help, went with batch file as noted above, works very well. Sorry I was unable to add to the thread while everyone was posting, being 12hours time diff means posting and waiting for the morning to see what has been posted.
Thanks
Ray
Perth WA
Ed Jobe
2005-05-25, 04:07 PM
Sorry...didn't even consider the command he was running. I was only thnking about the part where he wanted to keep a command window open.
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.