Jump to content

Errors when opening a specfic application


Recommended Posts

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.

Link to post
Share on other sites

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?

Link to post
Share on other sites

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

    No registered users viewing this page.

×
×
  • Create New...