Jump to content

Recommended Posts

Posted

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.

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
Posted

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

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

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...