miker95 Posted November 24, 2013 Share Posted November 24, 2013 (edited) Hello, I work for a comptuer shop and we are using AutoIT to perform daily tasks.We are currently writing a script to run at the start of our custom Win8 PE. This script will run chkdsk and defrag on every drive that is not drive B: or drive X:, as those are the ones used to run the PE. Writing out that part is no problem, we have that completely functional. The problem we are encountering is that when we open a command prompt in AutoIT using Run("X:WindowsSystem32cmd.exe") and we run the command dir *.exe it will return a different amount of files than if we run that same command in a prompt not opened by AutoIT. When the computer is in PE and we try to run RunWait("X:WindowsSystem32cmd /c chkdsk " & $drive_letter & " /f") we will get a 'chkdsk' is not a valid command' and we get this because in the AutoIT cmd window chkdsk.exe does not shop up on the dir *.exe list. Even in regular Windows the AutoIT command prompt returns a different amount of items, but it has chkdsk.exe on the list. Has anyone encountered this problem? Anyway to get around it? We have tried ShellExecute, RunAs(), and creating a batch file and the running it and that doesn't work. Edited November 24, 2013 by miker95 Link to comment Share on other sites More sharing options...
Developers Solution Jos Posted November 24, 2013 Developers Solution Share Posted November 24, 2013 (edited) Check if you are running x64 and compare with the dir result of "c:windowssyswow64". Jos Edited November 24, 2013 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
miker95 Posted November 24, 2013 Author Share Posted November 24, 2013 Oh man, they're the same from the one running from AutoIT and not from AutoIT. I don't have the PE on me right now so I won't be able to test it for a while but if that's the solution then I feel pretty silly... I'll give an update on whether or not it works in PE, thanks a bunch though. Link to comment Share on other sites More sharing options...
Starstar Posted November 24, 2013 Share Posted November 24, 2013 are you try like this????????? $CMD3 ="chkdsk" ;Type here your command $picPro2=RunWait('"'&@ComSpec&'"/c'&$CMD3,@SystemDir) 000 Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
miker95 Posted November 24, 2013 Author Share Posted November 24, 2013 (edited) are you try like this????????? $CMD3 ="chkdsk" ;Type here your command $picPro2=RunWait('"'&@ComSpec&'"/c'&$CMD3,@SystemDir) 000 Yes, we tried that as well which I forgot to mention, and that did not work either. We still got the 'chkdsk' is not a valid command error message. This is our first 64-bit PE, the others have been 32-bit so I'm fairly certain that compiling it for 64-bit and calling System32chkdsk will do the trick or calling SysWOW64chkdsk under a compiled 32-bit exe, we just didn't think of it that way. Edited November 24, 2013 by miker95 Link to comment Share on other sites More sharing options...
Gianni Posted November 24, 2013 Share Posted November 24, 2013 take a look >to this solution Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
miker95 Posted November 28, 2013 Author Share Posted November 28, 2013 Forgot to give an update on this. Compiling in 64-bit mode did work, so did running it from SysWOW64! Thanks, can't believe none of us thought of it. 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