Jump to content
Sign in to follow this  
Zein

Same command , but "Run" function shows different behavior from manually using command prompt.

Recommended Posts

Recently my hard drive died on me, and upon restoring all of my work and getting a fresh install of windows on a new SSD, my AutoIT's behavior has changed.

Scenario:
I have a batch file which launches a variety of other batch files and eventually launches my software. Along the way, Microsoft VS is used to compile temporary files.
Prior to my hard drive crashing, if I did:

Run("C:\Users\zein\Desktop\soft\soft\scripts\runSoft.bat")

It would successfully load the program from beginning to end.

But now if I try to do the same exact thing (no code changes in the batch file nor my autoIT script), I receive this error in my command prompt:
 

Error: "Cannot determine the location of the VS Common Tools folder."

If I manually use my command prompt to run the batch file, it works perfectly fine. What could cause AutoIT displaying different behavior from my manual attempts as well as my previous installation? 

Thanks.

 

If it matters, my previously compiled versions of the script (prior to hard drive failure) also cause the same issue now.

Share this post


Link to post
Share on other sites

I think it needs to run specifically in x86, but if it did need x64 how would I alter that? 

Tried to manually run it with a 32-bit cmd and it failed in the same way.
Looks like I do need a x64 now. 

Edited by Zein

Share this post


Link to post
Share on other sites

Depends whether you use AutoIt3Wrapper or not, but you either run it manually with autoit_x64.exe manually or use the AutoIt3Wrapper directive:

#AutoIt3Wrapper_UseX64=y

.. when you have the Full SciTE4AutoIt3 installed.

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.
  :)

Share this post


Link to post
Share on other sites
2 minutes ago, Jos said:

Depends whether you use AutoIt3Wrapper or not, but you either run it manually with autoit_x64.exe manually or use the AutoIt3Wrapper directive:

#AutoIt3Wrapper_UseX64=y

.. when you have the Full SciTE4AutoIt3 installed.

Jos

Worked like a charm, thank you!

First time I've run into a 86/64 bit difference, I'll keep it in mind in the future.

Share this post


Link to post
Share on other sites

If you want to use a single 32-bit script you can look at using _WinAPI_Wow64EnableWow64FsRedirection() function, find it easier to maintain one script rather than x86/x64 versions IMHO.

Example:
nb: C:\Windows\System32\CMD.exe can run in 32 or 64 bit mode.

#include <WinAPIFiles.au3>
_WinAPI_Wow64EnableWow64FsRedirection (False)
    ;Run 64-bit version
    RunWait(@ComSpec)
_WinAPI_Wow64EnableWow64FsRedirection (True)
;~ Run 32-bit version
RunWait(@ComSpec)

 

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...