This is probably so trivial it's embarrassing, but I'm not sure what to do.
I'll candidly admit I'm worse than a neophyte when it comes to VBScript or any Windows scripting; that said, I've managed to hack my way through some stuff, and it's _mostly_ working like I want: with the following exception:
The script writes a couple of files (including a batch file). These work. Trying to schedule the batch file for repeat execution every day (morning) at 2 a.m. is proving difficult. Here's what I'm working from:
When I run my script, the MsgBox spits back "2", which I know means there's a user access problem, but I'm not sure a) where or b) how to solve it.
I'm running things through an HTA file, so I don't know if that could cause the problem or not...
I'd appreciate any help! Thanks!
Also, things like objWMIService, strCurrentDir, etc., are Dim'd elsewhere. Incidentally, strCurrentDir, in this case, equals something like "F:\Users\Username\Blah\
I'll candidly admit I'm worse than a neophyte when it comes to VBScript or any Windows scripting; that said, I've managed to hack my way through some stuff, and it's _mostly_ working like I want: with the following exception:
The script writes a couple of files (including a batch file). These work. Trying to schedule the batch file for repeat execution every day (morning) at 2 a.m. is proving difficult. Here's what I'm working from:
Code:
Sub SheduleTask
Const MONDAY=1, TUESDAY=2, WEDNESDAY=4, THURSDAY=8, FRIDAY=16
strGMTOffset="-000"
Set objNewJob=objWMIService.Get("Win32_ScheduledJob")
objNewJob.Name="copy2docs"
errJobCreated=objNewJob.Create(strCurrentDir & "\c2d.bat", "********020000.000000" & strGMTOffset, _
True, MONDAY OR TUESDAY OR WEDNESDAY OR THURSDAY OR FRIDAY, , , JobID)
MsgBox errJobCreated
End Sub
When I run my script, the MsgBox spits back "2", which I know means there's a user access problem, but I'm not sure a) where or b) how to solve it.
I'm running things through an HTA file, so I don't know if that could cause the problem or not...
I'd appreciate any help! Thanks!
Also, things like objWMIService, strCurrentDir, etc., are Dim'd elsewhere. Incidentally, strCurrentDir, in this case, equals something like "F:\Users\Username\Blah\