Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

targetpath I need to remove all quotes

Status
Not open for further replies.

bhsupport

MIS
Oct 9, 2007
1
0
0
CA
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
 
...
strShortcutPath = "\\Bhapps\nstar\Pro\bin\prowin32.exe"
strShortcutArgs = "-basekey INI -ininame N:\HBE9000\bin\client.ini -pf N:\HBE9000\bin\newstar.pf -p N:\HBE9000\boot\startup.p -T %TEMP%"
...
oShellLink.TargetPath = strShortcutPath
oShellLink.Arguments = strShortcutArgs
...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top