Hello Everyone
I have a script that creates a desktop shortcut. In the targetpath I need to remove all quotes, so instead of
"\\Bhapps\nstar\Pro\bin\prowin32.exe -basekey INI -ininame N:\HBE9000\bin\client.ini -pf N:\HBE9000\bin\newstar.pf -p N:\HBE9000\boot\startup.p -T %TEMP%"
I would like it to read
\\Bhapps\nstar\Pro\bin\prowin32.exe -basekey INI -ininame N:\HBE9000\bin\client.ini -pf N:\HBE9000\bin\newstar.pf -p N:\HBE9000\boot\startup.p -T %TEMP% The short cut gets created on the desktop but with the quotes, once I remove the quotes the short cut works fine.
Script :
================
dim ObjFSO,StrDesktop,Systemroot,oShellLink
set WshShell = CreateObject("WScript.Shell")
set objFSO = CreateObject("Scripting.FileSystemObject")
strDesktop = WshShell.SpecialFolders("Desktop") & "\"
systemroot = WshShell.ExpandEnvironmentStrings("%Systemroot%") & "\"
' The section sets the variables.
strShortcutName = "NewStar"
strShortcutdir = "N:\HBE9000\Work"
strShortcutDesc = "HomeBuilder Enterprise 9000"
strShortcutPath = "\\Bhapps\nstar\Pro\bin\prowin32.exe -basekey INI -ininame N:\HBE9000\bin\client.ini -pf N:\HBE9000\bin\newstar.pf -p N:\HBE9000\boot\startup.p -T %TEMP%"
strShortcutIcon = "newstar.ico"
strShortcutIconLoc = "\\Bhapps\NSTAR\hbe9000\boot\"
'IF objFSO.FileExists(strDesktop & strShortcutName & ".lnk")= False Then
set oShellLink = WshShell.CreateShortcut(strDesktop & strShortcutName & ".lnk")
oShellLink.TargetPath = strShortcutPath
oShellLink.WorkingDirectory = strShortcutdir
oShellLink.WindowStyle = "1"
OBJfso.CopyFile strShortcutIconLoc & strShortcutIcon , Systemroot & strShortcutIcon ,True
oShellLink.IconLocation = Systemroot & strShortcutIcon
oShellLink.Description = strShortcutDesc
oShellLink.Save
'END If
'ShellLink.WorkingDirectory = strDesktop
'cleanup
set oShellLink = nothing
set WshShell = nothing
set objFSO = nothing
WScript.Quit
' eof
I have a script that creates a desktop shortcut. In the targetpath I need to remove all quotes, so instead of
"\\Bhapps\nstar\Pro\bin\prowin32.exe -basekey INI -ininame N:\HBE9000\bin\client.ini -pf N:\HBE9000\bin\newstar.pf -p N:\HBE9000\boot\startup.p -T %TEMP%"
I would like it to read
\\Bhapps\nstar\Pro\bin\prowin32.exe -basekey INI -ininame N:\HBE9000\bin\client.ini -pf N:\HBE9000\bin\newstar.pf -p N:\HBE9000\boot\startup.p -T %TEMP% The short cut gets created on the desktop but with the quotes, once I remove the quotes the short cut works fine.
Script :
================
dim ObjFSO,StrDesktop,Systemroot,oShellLink
set WshShell = CreateObject("WScript.Shell")
set objFSO = CreateObject("Scripting.FileSystemObject")
strDesktop = WshShell.SpecialFolders("Desktop") & "\"
systemroot = WshShell.ExpandEnvironmentStrings("%Systemroot%") & "\"
' The section sets the variables.
strShortcutName = "NewStar"
strShortcutdir = "N:\HBE9000\Work"
strShortcutDesc = "HomeBuilder Enterprise 9000"
strShortcutPath = "\\Bhapps\nstar\Pro\bin\prowin32.exe -basekey INI -ininame N:\HBE9000\bin\client.ini -pf N:\HBE9000\bin\newstar.pf -p N:\HBE9000\boot\startup.p -T %TEMP%"
strShortcutIcon = "newstar.ico"
strShortcutIconLoc = "\\Bhapps\NSTAR\hbe9000\boot\"
'IF objFSO.FileExists(strDesktop & strShortcutName & ".lnk")= False Then
set oShellLink = WshShell.CreateShortcut(strDesktop & strShortcutName & ".lnk")
oShellLink.TargetPath = strShortcutPath
oShellLink.WorkingDirectory = strShortcutdir
oShellLink.WindowStyle = "1"
OBJfso.CopyFile strShortcutIconLoc & strShortcutIcon , Systemroot & strShortcutIcon ,True
oShellLink.IconLocation = Systemroot & strShortcutIcon
oShellLink.Description = strShortcutDesc
oShellLink.Save
'END If
'ShellLink.WorkingDirectory = strDesktop
'cleanup
set oShellLink = nothing
set WshShell = nothing
set objFSO = nothing
WScript.Quit
' eof