> I'm new in the scripting business. I've found the scripts I need for my
> environment but they are all separate files, I need to combine all 5 files
> into one large vbs file. Here's a sample of two files I need to combine
> into
> one. Can someone please help.
>
> Thank you,
>
> Script 1:
>
> ' Already.vbs Windows Logon Script
> ' VBScript to map a network drive.
> ' Author Guy Thomas
http://computerperformance.co.uk/> ' Version 1.7 - April 24th 2005
> ' ------------------------------------------------------'
> Option Explicit
> Dim strDriveLetter, strRemotePath
> Dim objNetwork, objShell
> Dim CheckDrive, AlreadyConnected, intDrive
> ' The section sets the variables.
> strDriveLetter = "P:"
> strRemotePath = "\\server\staff"
>
> ' This sections creates two objects:
> ' objShell and objNetwork and counts the drives
> Set objShell = CreateObject("WScript.Shell")
> Set objNetwork = CreateObject("WScript.Network")
> Set CheckDrive = objNetwork.EnumNetworkDrives()
>
> ' This section deals with a For ... Next loop
> ' See how it compares the enumerated drive letters
> ' with strDriveLetter
> On Error Resume Next
> AlreadyConnected = False
> For intDrive = 0 To CheckDrive.Count - 1 Step 2
> If CheckDrive.Item(intDrive) =strDriveLetter _
> Then AlreadyConnected =True
> Next
>
> ' This section uses the If = then, else logic
> ' This tests to see if the Drive is already mapped.
> ' If yes then disconnects
> If AlreadyConnected = True then
> objNetwork.RemoveNetworkDrive strDriveLetter
> objNetwork.MapNetworkDrive strDriveLetter, strRemotePath
>
> ' The first message box
> objShell.PopUp "Drive " & strDriveLetter & _
> "Disconnected, then connected successfully."
> Else
> objNetwork.MapNetworkDrive strDriveLetter, strRemotePath
> objShell.PopUp "Drive " & strDriveLetter & _
> " connected successfully." End if
> WScript.Quit
>
> ' Guy's Script ends here
>
> Script 2:
>
> ' TwoMap.vbs - Map Network Drive to P: and S:
> ' Example of VBScript Mapping two drives in one script.
> ' Author Guy Thomas
http://computerperformance.co.uk/> ' Version 1.6 - April 24th 2005
> ' -----------------------------------------------------------------'
> Option Explicit
> Dim objNetwork, strRemotePath1, strRemotePath2
> Dim strDriveLetter1, strDriveLetter2
>
> strDriveLetter1 = "P:"
> strDriveLetter2 = "S:"
> strRemotePath1 = "\\server\staff"
> strRemotePath2 = "\\server\share"
>
> Set objNetwork = CreateObject("WScript.Network")
>
> ' Section which maps two drives, M: and P:
> objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1
> objNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2
>
> ' Extra code just to add a message box
> WScript.Echo "Map drives " & strDriveLetter1 & " & " & strDriveLetter2
>
> Wscript.Quit
>
> ' End of Windows Logon Script Example
>