I have the following VBS script, but keep getting errors in line 11, " path not found" even though all paths exist. can anyone point me in the right direction where the issue is.
Also is it possible to enter in a variable for the domain controller the user is authenticated to , rather than always use the same server location....
great site by the way!!!!
here is my script below
Option Explicit
Dim objFSO, objFolder, objShell, strDirectory, strFile, sourcelocation, targetlocation
strDirectory = "%ALLUSERSPROFILE%\Start Menu\Programs\Startup"
strFile = strDirectory & "\dynamicusb.exe"
' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
If Not objFSO.FileExists(strFile) Then
sourcelocation = "\\ssc-ad1\netlogon\dynamicUSB.exe"
targetlocation = strDirectory
objFSO.CopyFile sourcelocation, targetlocation, true
End If
WScript.Quit
Also is it possible to enter in a variable for the domain controller the user is authenticated to , rather than always use the same server location....
great site by the way!!!!
here is my script below
Option Explicit
Dim objFSO, objFolder, objShell, strDirectory, strFile, sourcelocation, targetlocation
strDirectory = "%ALLUSERSPROFILE%\Start Menu\Programs\Startup"
strFile = strDirectory & "\dynamicusb.exe"
' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
If Not objFSO.FileExists(strFile) Then
sourcelocation = "\\ssc-ad1\netlogon\dynamicUSB.exe"
targetlocation = strDirectory
objFSO.CopyFile sourcelocation, targetlocation, true
End If
WScript.Quit