This script creates a GroupWise icon on the desktop and adds the user name and Ipa switch to the target path. The script works fine until you examine the switch. The script is reversing the slashes in the switch to forward slashes not back slashes. What am I missing?
Ron
Option Explicit
Dim r
r = MsgBox("Would you like a shortcut to Notepad?", 36, "Create Shortcut?")
If r = 7 Then
WScript.quit
Else
Dim oshell, fso, Uname, Ipa
Set oshell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Dim shcut, d, dpath, wpath
Dim Swtc
dpath = oshell.SpecialFolders("Desktop")
wpath = "C:\Novell\GroupWise"
Uname = InputBox("Input a username Last_First):", "Staff members user name")
Ipa = InputBox("Input the Ipa address for your building.", "Building Ipa")
Swtc = (wpath + "\GrpWise.exe" & " /@u-" & Uname & " /Ipa-" & Ipa)
Set shcut = oshell.CreateShortcut(dpath & "\" & Uname & " GroupWise.lnk")
shcut.TargetPath = oshell.ExpandEnvironmentStrings(Swtc)
shcut.WorkingDirectory = oshell.ExpandEnvironmentStrings(wpath)
shcut.WindowStyle = 4
shcut.IconLocation = oshell.ExpandEnvironmentStrings(wpath & "\GrpWise.exe, 0")
shcut.Save
End If
Ron
Option Explicit
Dim r
r = MsgBox("Would you like a shortcut to Notepad?", 36, "Create Shortcut?")
If r = 7 Then
WScript.quit
Else
Dim oshell, fso, Uname, Ipa
Set oshell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Dim shcut, d, dpath, wpath
Dim Swtc
dpath = oshell.SpecialFolders("Desktop")
wpath = "C:\Novell\GroupWise"
Uname = InputBox("Input a username Last_First):", "Staff members user name")
Ipa = InputBox("Input the Ipa address for your building.", "Building Ipa")
Swtc = (wpath + "\GrpWise.exe" & " /@u-" & Uname & " /Ipa-" & Ipa)
Set shcut = oshell.CreateShortcut(dpath & "\" & Uname & " GroupWise.lnk")
shcut.TargetPath = oshell.ExpandEnvironmentStrings(Swtc)
shcut.WorkingDirectory = oshell.ExpandEnvironmentStrings(wpath)
shcut.WindowStyle = 4
shcut.IconLocation = oshell.ExpandEnvironmentStrings(wpath & "\GrpWise.exe, 0")
shcut.Save
End If