I may have solved my issue ... I hope ... I think my problem has to do with drive mapping ... when user logs on a script is run mapping all the drives, Q drive in my example below is on another server so I changed the code to direct it to the server URL.
Good Morning All,
I was wondering if anyone can lend a hand to this issue I am having. I have the script below which moves and renames a file. It works fine when the user profile is logged on however when windows scheduler tries to run the script over night ( and user is logged off) it does not run. I am running it on a server and have given administrator permissions in the scheduler. Any ideas how I can get this to run overnight?
Thanks,
Jeff
Dim objFSO
Dim today
dim xtime
today = Right("0" & Month(Date),2) & Right("0" & Day(Date),2) & Year(Date) & "_"
xTime = Hour(Now()) & Minute(Now()) & Second(Now())
Set objFSO = CreateObject("Scripting.FileSystemObject")
If (objFSO.FileExists("D:\HRLOGIX\EMP35FNH.CSV")) Then
objFSO.MoveFile "D:\HRLOGIX\EMP35FNH.CSV" , "Q:\HRLR\EMP35FNH_" & today & xTime & ".csv"
End If
If (objFSO.FileExists("D:\HRLOGIX\EMP35FRH.CSV")) Then
objFSO.MoveFile "D:\HRLOGIX\EMP35FRH.CSV" , "Q:\HRLR\EMP35FRH_" & today & xTime & ".csv"
End If
If (objFSO.FileExists("D:\HRLOGIX\EMP35GNH.CSV")) Then
objFSO.MoveFile "D:\HRLOGIX\EMP35GNH.CSV" , "Q:\HRLR\EMP35GNH_" & today & xTime & ".csv"
End If
If (objFSO.FileExists("D:\HRLOGIX\EMP35GRH.CSV")) Then
objFSO.MoveFile "D:\HRLOGIX\EMP35GRH.CSV" , "Q:\HRLR\EMP35GRH_" & today & xTime & ".csv"
End If
Set objFSO = Nothing
<message edited by jrs872 on Thursday, March 31, 2011 1:30 AM>