johntmcii Posted April 1, 2010 Share Posted April 1, 2010 I know the following script is not right on the sending of the enter key, but I've reviewed the FAQS and done some Topeka-ing on this (for sample scripts and for the proper syntax). What I'm attempting to do is get the StdinWrite to load a stream that will in turn format a flash drive. The only response that is required after the format statement is pressing an Enter key in response to a command prompt "Press Enter when ready...", but I'm not having any luck with this-- the $data is empty in the MsgBox. Any suggestions? TIA John Local $PID = Run("format " & $sf_fd_letter, @SystemDir, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) ; Write string to STDIN StdinWrite($PID, Send "{Enter}") ; Calling with no 2nd arg closes stream StdinWrite($PID) ; Read from child's STDOUT and show Local $data While True $data &= StdoutRead($PID) If @error Then ExitLoop Sleep(25) WEnd MsgBox(0, "Debug", $data) Link to comment Share on other sites More sharing options...
funkey Posted April 1, 2010 Share Posted April 1, 2010 Better run it with all needed parameters Look here: #524309 Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
johntmcii Posted April 1, 2010 Author Share Posted April 1, 2010 Thanks, mate! Link to comment Share on other sites More sharing options...
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