Here is the batch file...
----------------
@ECHO OFF
START "Launch TrueCrypt" /Dc:.\ /WAIT .\TrueCrypt.exe /Volume ComputerTechEZ /letter s /quit
START "Launch OC" /Ds:\OpenContactsPortable /WAIT s:\OpenContactsPortable\OpenContacts.exe
START "Dismount All TrueCrypt" /WAIT /B /Dc:.\ /WAIT TrueCrypt.exe /dismount s
ECHO Dismount completed successfully.
----------------
What I am trying to get it to do...
1. Launch TrueCrypt and mount the file ComputerTechEZ to drive S:
2. Then launches OpenContacts.exe which is within the drive
3. When OpenContacts.exe closes(which is done manually by the user at will) truecrypt then dismounts drive S:.
The problem is that TrueCrypt attempts to dismount right after OpenContacts.exe launches and does not wait. What am I doing wrong with the wait command?
/WAIT parameter not working?
Moderator: DosItHelp
Re: /WAIT parameter not working?
is pause occur before OpenContacts closed?Computer TechEZ wrote:The problem is that TrueCrypt attempts to dismount right after OpenContacts.exe launches and does not wait.
Code: Select all
TrueCrypt.exe /v ComputerTechEZ /l S /q
start "" /DS:\OpenContactsPortable /B /WAIT S:\OpenContactsPortable\OpenContacts.exe
pause
TrueCrypt.exe /d S /q
-
- Posts: 5
- Joined: 16 Jun 2010 19:50
Re: /WAIT parameter not working?
If I do
than truecrypt does not dismount until I press a key at the command window. I tried testing this code on Notepad.exe in place of OpenContacts.exe and the /WAIT command works. So for some reason using OpenContacts.exe with a /WAIT command does not actually wait. Why would that be?
Code: Select all
pause
TrueCrypt.exe /d S /q
than truecrypt does not dismount until I press a key at the command window. I tried testing this code on Notepad.exe in place of OpenContacts.exe and the /WAIT command works. So for some reason using OpenContacts.exe with a /WAIT command does not actually wait. Why would that be?
Re: /WAIT parameter not working?
promt for pressing any key occur immediately after starting OpenContacts ?..Computer TechEZ wrote:than truecrypt does not dismount until I press a key at the command window
Re: /WAIT parameter not working?
Computer TechEZ wrote:I tried testing this code on Notepad.exe in place of OpenContacts.exe and the /WAIT ...
Perhaps you are comparing Apples with Oranges !
If you issue the command "START /?" you get lots of obscure information.
"START /WAIT ...." is very much a "maybe does" / "may does NOT" sort of thing,
depending upon
"If Command Extensions are enabled"; and
"When executing an application that is a 32-bit GUI application"
It gives me a headache trying to predict what happens.
I have experience of different consequences between invoking My_Program as
START /WAIT My_Program
or
My_Program
Sometimes it suits my needs better with "START /WAIT", and sometimes without.
Regards
Alan
Below are a few POSSIBLY relevant snippets from "START /?" :-
command/program
If it is an internal cmd command or a batch file then
the command processor is run with the /K switch to cmd.exe.
This means that the window will remain after the command
has been run.
If it is not an internal cmd command or batch file then
it is a program and will run as either a windowed application
or a console application.
If Command Extensions are enabled, external command invocation
through the command line or the START command changes as follows:
When executing an application that is a 32-bit GUI application, CMD.EXE
does not wait for the application to terminate before returning to
the command prompt. This new behavior does NOT occur if executing
within a command script.