Jump to content

FileCreateShortcut command is inconsistently working


Recommended Posts

I created a program that was to create a shortcut in the start menu using the FileCreateShortcut command. The program had the following in it:

If $OS_VERS=("ALL") Then

If FileExists ("C:\Program Files (x86)") Then

;Enter Windows 64 options Here

$File_Check=StringFormat("%s\\UGS NX 6.0\\NX 6.0 Rolls Royce (x64).lnk",$Start_Menu)

$os_name=("x64")

$apps=("apps_x64")

$Shortcut=("l:\ug_start_bats\starter_x64.bat")

Else

;Enter Windows 32 options Here

$File_Check=StringFormat("%s\\UGS NX 6.0\\NX 6.0 Rolls Royce.lnk",$Start_Menu)

$os_name=("x86")

$apps=("apps")

$Shortcut=("l:\ug_start_bats\starter.bat")

EndIf

EndIf

FileCreateShortcut($Shortcut,$Start_Menu_path,"" ....

When I run the program as myself it was creating the shortcut correctly. We use SCCM and when the software is deployed, via SCCM the shrtcut is being created with the path "l:\ug_start\starter.bat" instead of "l:\ug_start_bats\starter.bat". I tried all types of changes to the script and it is still dropping part of the command.

In the same program I am trying to add a shortcut that points to p:\apps\application.cmd "p:\apps\application", by using the command:

FileCreateShortcut("p:\apps\application.cmd ""p:\apps\application""",$Start_Menu_command,"" ....

The resultant shortcut is pointing to "p:\apps\application.cmd "p:\apps\application". Notice the extra " at the beginning of the line. I have tried to make it a variable and it still passes the first " to the beginning of the line. This occurs no matter how I run the executable.

Anyone have any suggestions?

Link to comment
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
 Share

  • Recently Browsing   0 members

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