Jump to content

hyp3r

Member
  • Posts

    2
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United Kingdom

Everything posted by hyp3r

  1. Well boys and girls, I know this isn't related to unattended set-ups but you may be able to help me. I've got the below script which is not working 100% accurately. On the line it defines the target path (MyShortcut.TargetPath = .......) there's a section which goes .... & Chr(47) & "wrkgrp" ..... now Chr(47) is a /, why oh why is it appearing as a \ when the shortcut is built? Is windows in all it's "wisdom" auto-converting the character because thinks I've made a mistake? (for all you out there who don't know much about access - I need that to be a "/" What is going on folks? How can I force windows to accept that as a /? Dim WSHNetwork, fso, WSHShell, MyShortcut, StartMenuPath, intDrive, strDrive, DriveFlag, AppDrive, Quote, Workgroup Set fso = CreateObject("Scripting.FileSystemObject") intDrive = 9 'This refers to the alphabet (9=I, 10=J etc) DriveFlag = False Do strDrive = Chr(intDrive + 64) & ":" If fso.folderexists(strDrive & "\IBOS") Then msgbox strDrive Call IdentifyAppsDrive DriveFlag = True Elseif intDrive = 27 then msgbox "The VBScript can not locate your Chase Shared Drive" & vbnewline & _ vbnewline & "Please contact the BIT Team" DriveFlag = True Else intDrive = intDrive + 1 End If Loop Until DriveFlag = True '******************************************************************* Sub IdentifyAppsDrive() intDrive = 1 'This refers to the alphabet (1=A, 2=B etc) DriveFlag = False Do AppDrive = Chr(intDrive + 64) & ":" If fso.fileexists(AppDrive & "\W32APPS\MSOffice.97\Office\msaccess.exe") Then AppDrive = Appdrive & "\W32APPS\MSOffice.97\Office\msaccess.exe" Msgbox Appdrive Call MakeShortcut DriveFlag = True Elseif fso.fileexists(AppDrive & "\Program Files\Microsoft Office\Office\msaccess.exe") Then AppDrive = Appdrive & "\Program Files\Microsoft Office\Office\msaccess.exe" msgbox appdrive Call MakeShortcut DriveFlag = True Elseif intDrive = 27 then msgbox "The VBScript can not locate your app's drive" & vbnewline & _ vbnewline & "Please contact the BIT Team" DriveFlag = True Else intDrive = intDrive + 1 End If Loop Until DriveFlag = True End Sub '******************************************************************* Sub MakeShortcut() Set WSHShell = WScript.CreateObject("WScript.Shell") Quote = Chr(34) WorkGroup = Chr(47) & "wrkgrp" ' Read desktop path using WshSpecialFolders object StartMenuPath = WSHShell.SpecialFolders("StartMenu") if fso.fileexists(StartMenuPath & "\Overtime.lnk") then fso.deletefile(StartMenuPath & "\Overtime.lnk") end if ' Create a shortcut object on the desktop Set MyShortcut = WSHShell.CreateShortcut(StartMenuPath & "\Overtime.lnk") ' Set shortcut object properties and save it MyShortcut.TargetPath = WSHShell.ExpandEnvironmentStrings(AppDrive & Quote & " " & Quote & strDrive & "\IBOS\Overtime\Secure Overtime.mdb" & Quote & " " & Chr(47) & "wrkgrp" & " " & Quote & strDrive & "\IBOS\Overtime\eobot.mdw") MyShortcut.WorkingDirectory = WSHShell.ExpandEnvironmentStrings(strDrive & "\IBOS\Overtime") MyShortcut.WindowStyle = 4 MyShortcut.IconLocation = WSHShell.ExpandEnvironmentStrings(strDrive & "\IBOS\Overtime\bit.ico, 0") MyShortcut.Save WScript.Echo "A shortcut to the Overtime database now exists on your Start Menu." End Sub
×
×
  • Create New...