Hi All,
First time poster here
My problem is I want to execute an exe and I want the command prompt to wait until the program is finished.
Not sure if I have explained myself all that well so if you need any more information I'll provide it.
Thanks,
Dave
holding the prompt until the exe is finished
Moderator: DosItHelp
-
- Posts: 16
- Joined: 16 Jul 2010 01:29
Re: holding the prompt until the exe is finished
first download a file called Nircmd
http://www.nirsoft.net/utils/nircmd.html
in my code you will see me waiting for the exe and then starting it up after the exe is closed
and it also hids my cmd box if the title of the box was SpyBot_Loader
http://www.nirsoft.net/utils/nircmd.html
in my code you will see me waiting for the exe and then starting it up after the exe is closed
and it also hids my cmd box if the title of the box was SpyBot_Loader
Code: Select all
nircmd exec show "%systemdrive%\spybot\RunSpybot.exe"
nircmd win hide ititle "SpyBot_Loader"
nircmd waitprocess RunSpybot.exe
nircmd waitprocess Spybotsd.exe
nircmd win show ititle "SpyBot_Loader"
Re: holding the prompt until the exe is finished
unfortunately I have to do it from the command prompt without installing any other software(i'm in work). If there is a VBScript way of doing it I could use that
-
- Posts: 16
- Joined: 16 Jul 2010 01:29
Re: holding the prompt until the exe is finished
sorry i dont know vb only .bat and .com coding
the nircmd is a exe that allows you to do additional coding in your cmd(.bat/.com) files
just by typing nircmd(your .bat file has to be in the same folder as the nircmd.exe)
and then your command eg:
you can run a host of functions in your bat scripts
their is a lot of things you can do just read the help files on the web site to see what functions nircmd offers
the nircmd is a exe that allows you to do additional coding in your cmd(.bat/.com) files
just by typing nircmd(your .bat file has to be in the same folder as the nircmd.exe)
and then your command eg:
Code: Select all
nircmd waitprocess RunSpybot.exe
you can run a host of functions in your bat scripts
their is a lot of things you can do just read the help files on the web site to see what functions nircmd offers
Re: holding the prompt until the exe is finished
From the command prompt you have to use START /WAIT.
If this doesn't work, you have to write the entire path.
Regards
aGerman
Code: Select all
start "" /wait "name.exe"
If this doesn't work, you have to write the entire path.
Regards
aGerman
Re: holding the prompt until the exe is finished
that was exactly what I was looking for.
Thanks,
Dave
Thanks,
Dave