Jump to content

Autoit won't run DOS command


Zad
 Share

Recommended Posts

I have this weird problem...

 

Autoit cannot run this properly:

 

   $DOS = Run('c:\windows\system32\msg.exe Billy test', "", $STDOUT_CHILD + $STDERR_CHILD)

 

When I change the command to:

 

   $DOS = Run('cmd /k c:\windows\system32\msg.exe fernando test', "", $STDOUT_CHILD + $STDERR_CHILD)

 

It produces the following error

'c:\windows\system32\msg.exe' is not recognized as an internal or external command operable program or batch file.

 

Since the command prompt remains open I can check a few things.  When I go to c:\windows\system32 and do a dir *.exe, for some reason msg.exe is not listed.  However if I just click on Start->Run and open up a command prompt that way and go to c:\windows\system32 and do a dir *.exe msg.exe does show up.  msg.exe is a messaging utility that is included with windows 7/8.

As a test I copied msg.exe from c:\windows\system32 to c:\temp and I can run it from there just fine, seems like a problem with c:\windows\system32 being a system folder.

 

I am going crazy trying to make this work.  Would appreciate any help. 

 

 

Link to comment
Share on other sites

That worked!  Thanks for taking the time to help me.

This is what I'm using:

SciTE-Lite 
Version 3.5.4

Looks like I'm using the 32-bit version, but I think I installed both.

I work mostly with 64-bit systems...should I just re-install the 64-bit version only?

 

Link to comment
Share on other sites

Your welcome.  Since you have SciTe-Lite, that is why the directive wouldn't work.  You can download the full installer for SciTE4AutoIt3, and to see its only Help file.  It includes a lot of things that will help with scripting.  AutoIt installs both the 32 and 64 bit versions.  When you install AutoIt on a 64-bit system, you have the choice to use the 32 or 64 bit by default.  I usually just use the directive to switch between the two.  I usually only use the 64-bit version when I really need to.  

 

Adam

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...