Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

windows logon script help

Status
Not open for further replies.

sugu

Programmer
Jan 12, 2004
90
0
0
SG
HI,

I'm trying to figure out on how to write a windows logon script to copy a file to all the client systems (win XP sp2) from win 2003 gpo?


Thanks!

-su
 
obviously you first need to get the file copied to the workstations but that is not that big of a deal. Then you can schedule the task like this:

Code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set objNewJob = objWMIService.Get("Win32_ScheduledJob")

errJobCreated = objNewJob.Create _
    ("Notepad.exe", "********123000.000000-420", _
        True , 1 OR 4 OR 16, , , JobID) 
Wscript.Echo errJobCreated

Notice the "1 or 4 or 16" Those represent days of the week to run.

Monday= "1"
Tuesday="2"
Wednesday="4"
Thursday="8"
Friday="16"
Saturday="32"
Sunday="64"

Additional details can be found here:

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top