Otte Posted April 23, 2007 Share Posted April 23, 2007 I am trying to run some Windows commands within a script to delete files but it seems to be failing for some reason. My code looks like this RunWait(@ComSpec & " /c " & 'del test.zip') I am running the script from the same directory where the file is located and if I run the command from cmd.exe then the file gets deleted. I am running this on Windows 2003 64 bit version which may have something to do with it as the code works on a 32 bit 2003 server. I have added Message boxes to try and find out what error is that the command gives but only get a 1 as the result code. Is there a way to see the error or write the error to file that the command outputs? Regards Otte Link to comment Share on other sites More sharing options...
Developers Jos Posted April 23, 2007 Developers Share Posted April 23, 2007 Is there a way to see the error or write the error to file that the command outputs?RunWait(@ComSpec & ' /k del test.zip') 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...
Otte Posted April 23, 2007 Author Share Posted April 23, 2007 Thanks for your help, I have now solved the problem, it was to do with working directories. Otte Link to comment Share on other sites More sharing options...
Bert Posted April 23, 2007 Share Posted April 23, 2007 ShellExecute also works well. The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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