Jump to content
Sign in to follow this  
willwatters

Errors when opening a specfic application

Recommended Posts

willwatters

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.

Share this post


Link to post
Share on other sites
Nuffilein805

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?

Share this post


Link to post
Share on other sites
LxP

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 by LxP

Share this post


Link to post
Share on other sites
MHz

Edit: Alternatively you could simply construct a proper Run() command from the details found

Looks 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)

Share this post


Link to post
Share on other sites
LxP

When did I forget how to read properly? :">

It still may not hurt to look into _ShellExecute() if all else fails.

Share this post


Link to post
Share on other sites
MHz

When did I forget how to read properly? :">

B) We all slip up sometimes.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.