|
Post by mcspam on Jul 9, 2019 19:50:29 GMT 1
I'm trying to run the command wmic csproduct get name, uuid >UUID.txt from vDos. I can do it manually by typing CMD, entering into the command window and then running the command. This works fine. But I set it in a bat file MIC.BAT and from vDos typed CMD WAIT /C MIC.BAT and I get a error message in UUID.TXT Tried dozens of variations to the CMD syntax with no joy.
Anyone know a way to make this work? I'm using WIN 10 64 if that matters.
|
|
|
Post by Jos on Jul 9, 2019 20:23:35 GMT 1
WAIT won’t do anything since CMD will just (try to) start wmic and exit immediately. Though HIDE will hide the CMD window.
Your MIC.BAT would also just contains “wmic csproduct get name, uuid >UUID.txt”. I tested that and it works as expected. What vDos version do you use?
Eventually start vDos with the log option (“…vDos.exe” /log) and post the generated vDos.log file.
Jos
|
|
|
Post by mcspam on Jul 9, 2019 20:33:43 GMT 1
I took WAIT out. log attached. Thank you.
Attachments:vDos.log (162 B)
|
|
|
Post by Jos on Jul 9, 2019 20:45:48 GMT 1
I reckon mic.bat doesn’t create UUID.TXT, at least not in (Windows) L:\Environment\, as the "OpenFile failed" reports.
What if you add PAUSE at the end of mic.bat, the Windows current work directory isn’t L:\Environment\ at that moment?
Eventually also rename mic.bat to mic.cmd, to differentiate it from a DOS batch file.
Jos
|
|
|
Post by mcspam on Jul 9, 2019 21:01:42 GMT 1
Now that I see different things it seems to be having some kind of media protection problem - again only in vDOS not if I manually go into CMD where everything works fine. I changed the line to
cmd HIDE /c wmic csproduct get name, uuid >UUID.txt and now UUID.TXT is an empty file instead of the error message. Weird.
I'm going to try it on another com puter later and see if the protection error goes away. Thanks.
|
|
|
Post by Jos on Jul 9, 2019 21:13:50 GMT 1
The “>” redirection can be tricky. At the vDos command prompt it signals vDos to set the default output device to UUID.txt. But you start CMD, that doesn’t output anything to vDos. So at the vDos command prompt it should be: cmd HIDE /c "wmic csproduct get name, uuid >UUID.txt"
So the “>” isn’t trapped (and removed) by vDos, but passed on to CMD.
Jos
|
|
|
Post by mcspam on Jul 9, 2019 21:17:53 GMT 1
It worked! Thank you for your rapid response.
|
|