Cmd /c schtasks

From: [email protected] [mailto:[email protected]] On 
Behalf Of Marcum, John
Sent: Monday, August 10, 2015 10:15 AM
To: Scripting List ([email protected])
Subject: [scripting] Simple VBScript to Delete Scheduled Tasks

Can anyone tell me why this incredibly simple script that I stole from someone 
else does not work. After running the script the scheduled tasks are still 
present.

On Error Resume Next
Set objShell = WScript.CreateObject("WScript.Shell")
Set objExecObject = objShell.Exec("cmd c schtasks /Delete /TN ""\Adobe Acrobat 
Update Task"" /F")
Set objExecObject = objShell.Exec("cmd c schtasks /Delete /TN 
""\microsoft\windows\Application Experience\AitAgent"" /F")
Set objExecObject = objShell.Exec("cmd c schtasks /Delete /TN 
""\microsoft\windows\Customer Experience Improvement Program\Consolidator"" /F")
Set objExecObject = objShell.Exec("cmd c schtasks /Delete /TN 
""\Microsoft\Windows\Defrag\ScheduledDefrag"" /F")
Set objExecObject = objShell.Exec("cmd c schtasks /Delete /TN 
""\microsoft\windows\Customer Experience Improvement Program\KernelCeipTask"" 
/F")
Set objExecObject = objShell.Exec("cmd c schtasks /Delete /TN 
""\microsoft\windows\Application Experience\ProgramDataUpdater"" /F")
Set objExecObject = objShell.Exec("cmd c schtasks /Delete /TN 
""\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip"" /F")

wscript.quit



________________________________
        John Marcum
            MCITP, MCTS, MCSA
              Desktop Architect
   Bradley Arant Boult Cummings LLP
________________________________

  [H_Logo]


________________________________

Confidentiality Notice: This e-mail is from a law firm and may be protected by 
the attorney-client or work product privileges. If you have received this 
message in error, please notify the sender by replying to this e-mail and then 
delete it from your computer.



The information contained in this E-mail transmission is
intended only for the use of the individual or entity to whom
it is addressed. It may contain privileged, confidential,
and protected health information.

If you received it in error, you are on notice of its status.
Please notify us immediately by reply e-mail and then please
delete this message from your system. Please do not copy it
or use it for any purposes, or disclose its contents to any
other person. To do so could violate state and Federal
privacy laws. Thank you for your cooperation.
Please contact the sender if you need assistance.

Dedicated to Hope, Healing and Recovery.

Reply via email to