weirddave Posted January 3, 2017 Share Posted January 3, 2017 (edited) I am trying to pass some parameters to another script using ShellExecute, thisworks fine on Win10 but not on Win7. I have cut the code down to the bare minimum to illustrate the problem. This is the code with ShellExecute $test_Params = "a b" ShellExecute("shellexecute_test.au3", $test_Params) This is the code that is being called (shellexecute_test.au3): msgbox(0,"",$CmdLine[0]) The win7 PC reports 0, Win10 reports 2 Could there be a permissions issue? Is there another way to make this work? Edited January 3, 2017 by weirddave Link to comment Share on other sites More sharing options...
Subz Posted January 3, 2017 Share Posted January 3, 2017 Can you confirm that if you double click "shellexecute_test.au3" on Windows 7 that it executes, opens in Scite or does nothing? It sounds like file associations aren't added. Link to comment Share on other sites More sharing options...
weirddave Posted January 3, 2017 Author Share Posted January 3, 2017 It runs, I get a message box with 0 in it (which would be correct when launching it this way). If it wasn't launching correctly I wouldn't get the msgbox at all with the shellexecute method I'm actually double-clicking the au3 with the shellExecute in it as it happens. If I compile shellexecute_test it works, but this isn't convenient for debugging Link to comment Share on other sites More sharing options...
Subz Posted January 3, 2017 Share Posted January 3, 2017 Sorry was a little confused by your first post, I've tested on Windows 7 and Windows 10 and I get MsgBox with 2 on both systems, I do have UAC switched off on Windows 7. Windows Enterprise 7/10 64 bit with AutoIT 3.3.14.2 Link to comment Share on other sites More sharing options...
weirddave Posted January 3, 2017 Author Share Posted January 3, 2017 Thanks for trying it. The Win7 PC is somewhat locked down, which is why my first suspect is a permissions issue. I could do with a workaround, debugging without line numbers in the error is a pain, lol Link to comment Share on other sites More sharing options...
PeteF Posted January 4, 2017 Share Posted January 4, 2017 Try running the *.exe script "as administrator" . If that solves the problem, it could be the particular AnitVirus program installed on the PC that is interfering with program operation or it could be the security settings of Windows itself. -pete Link to comment Share on other sites More sharing options...
caramen Posted January 4, 2017 Share Posted January 4, 2017 @weirddave hi did you checked the ps restriction ? do you execute the powershell command in the rigth directory ? Is powershell installed on w7 computer also ? If no you have to import powershell module My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Subz Posted January 4, 2017 Share Posted January 4, 2017 @weirddave - Can you check the value of RegRead('HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Run\Command', '') Just wondering if its missing parameters on the command line e.g."C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "%1" %* weirddave 1 Link to comment Share on other sites More sharing options...
weirddave Posted January 4, 2017 Author Share Posted January 4, 2017 Regedit told me that the key was set to "C:\engsys\AutoIt\AutoIt3.exe" "%1" I have changed it to "C:\engsys\AutoIt\AutoIt3.exe" "%1" %* which seems to have fixed it. Interestingly, my key name was HKEY_CLASSES_ROOT\Applications\AutoIt3.exe\shell\open\command I suspect what I've done is associate au3 files with the exe rather than install autoit on this particular PC. It's coming back to me now, the admin doesn't want to see "random" installs that aren't on the approved list and C:\engsys is ignored by the virus protection here 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