Sign in to follow this  
Followers 0
willwatters

Errors when opening a specfic application

6 posts in this topic

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



#3 ·  Posted (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 by LxP

Share this post


Link to post
Share on other sites

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

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

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  
Followers 0