willwatters Posted November 2, 2005 Posted November 2, 2005 The run ($mycommandline,"",@SW_MAXIMIZE) causes a 16 bit ms dos subsystem error in Windows XP. The error states the NTVDM CPU has encountered an illegal instruction. Choose close to terminate the application. Please review the following code: ;/* Check the application/desktop icon exists $Location=(@DesktopCommonDir & "\Citrix Program Neighborhood.lnk2") If Not FileExists($Location) Then _MyLog($Post, "21", "Citrix", "Application/desktop icon does not exist", "") Exit EndIf ;/* Read in the path of a shortcut $details = FileGetShortcut(@DesktopCommonDir & "\Citrix Program Neighborhood.lnk2") $mycommandline = $details[0]& " " & $details[2] ;/* launch the application run ($mycommandline,"",@SW_MAXIMIZE) Does anyone know why this is and how to resolve it, ie. by using a different method to open the application> Thanks.
Nuffilein805 Posted November 2, 2005 Posted November 2, 2005 have you ever tried using this without $details[2] does it work without? maybe you should "_rundos" it #include<process.au3> _rundos($mycommandline) but as you want your window to max it's maybe a not so good idea does this prog usually run if you don't start it with autoit? my little chatmy little encryption toolmy little hidermy unsafe clickbot
LxP Posted November 3, 2005 Posted November 3, 2005 (edited) Run() only works with executable files -- .LNK files are merely non-executable files that point to one. Try obtaining SlimShady's _ShellExecute() UDF, which will work as expected with any defined file type.Edit: Alternatively you could simply construct a proper Run() command from the details found in that .LNK.; Built from the Calculator link in the Start menu ; Target: %SystemRoot%\system32\calc.exe ; Start in: C:\WINDOWS\system32 ; Run: Normal window Run(EnvGet('SystemRoot') & '\system32\calc.exe', 'C:\WINDOWS\system32') Edited November 3, 2005 by LxP
MHz Posted November 3, 2005 Posted November 3, 2005 Edit: Alternatively you could simply construct a proper Run() command from the details foundLooks like what the 1st post does with FileGetShortcut() ?The shortcut properties gives the command. Look at the quotes used in the shortcut properties. I would advise using a working directory for running programs.Run('"' & $details[0] & '" ' & $details[2], $details[1], @SW_MAXIMIZE)
LxP Posted November 3, 2005 Posted November 3, 2005 When did I forget how to read properly? :">It still may not hurt to look into _ShellExecute() if all else fails.
MHz Posted November 3, 2005 Posted November 3, 2005 When did I forget how to read properly? :"> We all slip up sometimes.
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