Syekick Posted January 31, 2008 Posted January 31, 2008 I'm trying to get one DOS run command to "run" after the first closes. The time that #1 will remain open will be variable because of the quantity of documents each user has. When I run the program compiled, #2 must be executing before #1 finishes as I do not get the output file. When run separately, manually, it works fine. 1. Run(@Comspec & ' /c cipher.exe /e /a /s:"' & "C:\Documents and Settings\" & @UserName & "\My Documents" & '"') After the above line executes, fully, and the DOS window closes I need to continue in my program by running: 2. Run(@Comspec & ' /c cipher /x c:\' & @UserName & "_" &@ComputerName & '.pfx', 'c:\') The problem seems to be that 2 starts executing either immediately or too soon. I've added Sleep(500) ;500 milliseconds and between the two and that has not helped. Is there any way to detect when #1 closes so I can then execute #2?
whim Posted January 31, 2008 Posted January 31, 2008 Use RunWait instead of the first Run (see helpfile)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now