Sign in to follow this  
Followers 0
Otte

Running Windows Commands

4 posts in this topic

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

Share this post


Link to post
Share on other sites



Is there a way to see the error or write the error to file that the command outputs?

RunWait(@ComSpec & ' /k del test.zip')

:shocked:


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thanks for your help, I have now solved the problem, it was to do with working directories.

Otte

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0