[windows2000] Re: Pushing a scheduled job to all computers on a domain

  • From: "Sorin Srbu" <sorin.srbu@xxxxxxxxxxxxx>
  • To: <windows2000@xxxxxxxxxxxxx>
  • Date: Thu, 22 Mar 2007 08:45:45 +0100

Sullivan, Glenn <> wrote on Wednesday, March 21, 2007 12:25 PM:

See below:

Defrag_all.vbs
---
'defrag_all.vbs - Defrags all hard disks - Can be run as a Scheduled Task
'C Doug Knox - 3/29/2002

Set WshShell = WScript.CreateObject("WScript.Shell")

   Dim fso, d, dc
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set dc = fso.Drives
   For Each d in dc
      If d.DriveType = 2 Then
        Return = WshShell.Run("defrag " & d & " -f", 1, TRUE)
      End If
   Next

Set WshShell = Nothing
---

From <<<http://www.dougknox.com/xp/xp_fixes.html>>>


I use psexec to run a daily inventory, but lately it hasn't run, says there
are no admin shares or some such. It worked before... Go figure. 8-/

Thx for the clarification on "for ... in"! I googled for it yesterday but the
examples weren't that informative and in most cases ambivalent as to what goes
where.



> For %f in (filename.txt) do echo %f
> 
> This will echo every line in the text file, so replace the "Echo %f"
> with a remote AT command, or use PSExec to remotely run AT on that
> machine.
> 
> Me, I'd use VBScript to do it if possible in a startup script.  Some
> samples are in the repository:
> http://www.microsoft.com/technet/scriptcenter/scripts/os/tasks/default.m
> spx
> 
> I'd be interested in the Defrag script though... Can you save it as a
> txt file and post it?
> 
> Glenn Sullivan, MCSE+I MCDBA
> David Clark Company Inc.
> -----Original Message-----
> From: windows2000-bounce@xxxxxxxxxxxxx
> [mailto:windows2000-bounce@xxxxxxxxxxxxx] On Behalf Of Sorin Srbu
> Posted At: Wednesday, March 21, 2007 5:23 AM
> Posted To: Windows 2000
> Conversation: [windows2000] Re: Pushing a scheduled job to all computers
> on a domain
> Subject: [windows2000] Re: Pushing a scheduled job to all computers on a
> domain
> 
> 
> Dave stevens <> wrote on Wednesday, March 21, 2007 10:07 AM:
> 
> Yupp, seems like the at command will do the thing. I don't however
> understand how to tell it to use the computernames I have in the
> txt-file.
> 
> Some kind of loop like "run this command on the computers in the list"
> would be suitable. I recall some "for in %%..." something or other
> command in batch scripting, but can never remember how to...
> 
> 
> 
>> Yes, This can be done with the AT command. I believe the AT coomand
>> allows you to schedual jobs on a remote computer. You might need to
>> direct this to a text file with all the host names. Do a help on AT it
>> will offer you options. Hope this helps. 
>> 
>> 
>> Dave
>> 
>> Sorin Srbu <sorin.srbu@xxxxxxxxxxxxx> wrote:
>> 
>>      Hi all,
>> 
>>      I found a vb-script that runs from the CLI and that defags all
harddrives
>>      it finds on a system. The auhor mentions that it's easy to
> schedule
> using
>>      the task scheduler. This would most probably work for us if I set the
>>      script to execute as System or some other privilegied account, so
>> that
> the
>>      normal user (who isn't allowed to run a defrag) can have a
> defragged
> gd on
>>      a regular basis.
>> 
>>      I'm able to push the script to all clients, but is there a way
> to add
> a
>>      task to all client computers from one location (like my admin
>>      workstation)? I'm not really sure how one would do this. Can you ppl
>> suggest a simple way? 
>> 
>>      TIA.
>> 
>> 
>>      BW,
>> 
>>      Sorin
>> 
>>      # Sorin Srbu, Systems Engineer Web: http://www.orgfarm.uu.se
>>      # Dept of Medicinal Chemistry, Phone: +46 (0)18-4714482 >3
> signals>
> GSM
>>      # Div of Org Pharm Chem, Mobile: +46 (0)701-718023
>>      # Box 574, Uppsala University, Fax: +46 (0)18-4714482
>>      # SE-751 23 Uppsala, Sweden Visit: BMC, Husargatan 3, D5:512b   #
>>      # () ASCII ribbon campaign - Against html E-mail
>>      # /\
>>      #
>>      # Harmless tagline follows:
>>      #
>>      # Some things Man was never meant to know. For everything else,
there's
>> Google. 
>> 
>>      *****************************
>>      New Site from The Kenzig Group!
>>      Windows Vista Links, list options
>>      and info are available at:
>>      http://www.VistaPop.com
>>      *****************************
>>      To Unsubscribe, set digest or vacation
>>      mode or view archives use the below link.
>> 
>>      http://thethin.net/win2000list.cfm
>> 
>> 
>> 
>> ________________________________
>> 
>> Sucker-punch spam
>> 
> <http://us.rd.yahoo.com/evt=49981/*http://advision.webevents.yahoo.com/m
> ailbet
> a/features_spam.html>
>> with award-winning protection.
>> Try the free Yahoo! Mail Beta.
>> 
> <http://us.rd.yahoo.com/evt=49981/*http://advision.webevents.yahoo.com/m
> ailbet
> a/features_spam.html>
> 
> *****************************
> New Site from The Kenzig Group!
> Windows Vista Links, list options
> and info are available at:
> http://www.VistaPop.com
> *****************************
> To Unsubscribe, set digest or vacation
> mode or view archives use the below link.
> 
> http://thethin.net/win2000list.cfm
> *****************************
> New Site from The Kenzig Group!
> Windows Vista Links, list options
> and info are available at:
> http://www.VistaPop.com
> *****************************
> To Unsubscribe, set digest or vacation
> mode or view archives use the below link.
> 
> http://thethin.net/win2000list.cfm

*****************************
New Site from The Kenzig Group!
Windows Vista Links, list options 
and info are available at:
http://www.VistaPop.com
***************************** 
To Unsubscribe, set digest or vacation
mode or view archives use the below link.

http://thethin.net/win2000list.cfm

Other related posts: