Jump to content

right click ".au3" then left click "Run Script(x64)" works - double click doesn't


Recommended Posts

Have spent quite a while on this but currently flagging - would appreciate any comment.    

The following (Win7 64bit) local autoit "au3" file starts the same remote "WIP-GUI.au3" script (a GUI) on both network connected machines when I right click the file and press "Run Script(x 64)" but, apparently, does not when I double click the file:

;WinXP machine, currently "Remote1":-:
Run('psexec \\Remote1 -u Multicam -p abcd -i -d "C:\Program Files\Autoit3\AutoIt3.exe" "C:\Documents and Settings\Multicam\Desktop\AutoIt-GUI\WIP-GUI.au3"', '', @SW_HIDE)
;Win7 machine, currently "Remote2":-
Run('psexec \\Remote2 -u Multicam -p abcd -i -d "C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "C:\Users\Multicam\Desktop\AutoIt-GUI\WIP-GUI.au3"', '', @SW_HIDE)

Should I have expected the same outcome from either action?

I need, somehow, to attach the script example to a function in a local GUI to have a button start the remote GUI's.   

 

 

 

Link to comment
Share on other sites

Edit, looks like your script is running.

I assume the issue is with a x86/x64 difference.

 

If you right click and "Run Script(x86)" does it give the same result as if you double click?  If so thats the issue.  The solution is how you compile it or to specify in the script to use the system files you want.

Edited by ViciousXUSMC
Link to comment
Share on other sites

If you right click and "Run Script(x86)" does it give the same result as if you double click?  If so thats the issue.  The solution is how you compile it or to specify in the script to use the system files you want.

Thanks ViciousXUSMC .

Yes, with Run Script(x86)  the same occurs as with double click - nothing, apparently, happens.

I think your assumption (I assume the issue is with a x86/x64 difference) is probably correct.

For my intended solution, if possible, I do not wish to compile but to continue with ".au3" files. I had briefly reviewed this: 

https://www.autoitscript.com/autoit3/docs/intro/64-bit_support.htm 

prior to posting but am currently no wiser in how to specify, in the script, how to use the required "system files".

Any further hint would be appreciated.

Link to comment
Share on other sites

Ok, this works:

#include <WinAPIFiles.au3>
_WinAPI_Wow64EnableWow64FsRedirection(False)

;WinXP machine, currently "Remote1":-:
Run('psexec \\Remote1 -u Multicam -p abcd -i -d "C:\Program Files\Autoit3\AutoIt3.exe" "C:\Documents and Settings\Multicam\Desktop\AutoIt-GUI\WIP-GUI.au3"', '', @SW_HIDE)

;Win7 machine, currently "Remote2":-
Run('psexec \\Remote2 -u Multicam -p abcd -i -d "C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "C:\Users\Multicam\Desktop\AutoIt-GUI\WIP-GUI.au3"', '', @SW_HIDE)

credit to ViciousXUSMC at https://www.autoitscript.com/forum/topic/173587-help-with-netshexe/?do=findComment&comment=1255717 

Edited by newniman
Link to comment
Share on other sites

  • 4 weeks later...
[HKEY_CLASSES_ROOT\AutoIt3Script\Shell]
@="Run"

[HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Run]
@="Run Script"

[HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Run\Command]
@="\"C:\\Program Files (x86)\\AutoIt3\\AutoIt3.exe\" \"%1\" %*"

[HKEY_CLASSES_ROOT\AutoIt3Script\Shell\RunX86]
@="Run Script (x86)"

[HKEY_CLASSES_ROOT\AutoIt3Script\Shell\RunX86\Command]
@="\"C:\\Program Files (x86)\\AutoIt3\\AutoIt3.exe\" \"%1\" %*"

[HKEY_CLASSES_ROOT\AutoIt3Script\Shell\RunX64]
@="Run Script (x64)"

[HKEY_CLASSES_ROOT\AutoIt3Script\Shell\RunX64\Command]
@="\"C:\\Program Files (x86)\\AutoIt3\\AutoIt3_x64.exe\" \"%1\" %*"

"Run" and "Run (x86)" are actually the same command if you don't modify the shell extension to be x64 by default. So you've been running the x86 version every time.

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