[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 490
  • Last Modified:

Convert Bat File to VB Script?

Can someone please help me convert this line of bat file into VB Script format? Thank you.

@echo off
 schtasks.exe /change /tn "\Microsoft\ScheduedTask1" /enable
 schtasks.exe /run /tn "\Microsoft\ScheduedTask1"
 schtasks.exe /end /s server1.domain.com /tn "\Microsoft\ScheduedTask1"
 schtasks.exe /change /s server1.domain.com /tn "\Microsoft\ScheduedTask1" /disable
0
mmoya
Asked:
mmoya
  • 2
1 Solution
 
sirbountyCommented:
Basically this should do it...
Dim objShell : Set objShell = CreateObject("Wscript.Shell")

With objShell
  .Run "schtasks.exe /change /tn " & chr(34) & "\Microsoft\ScheduedTask1" & chr(34) & " /enable"
  .Run "schtasks.exe /run /tn " & chr(34) & "\Microsoft\ScheduedTask1" & chr(34)
  .Run "schtasks.exe /end /s server1.domain.com /tn " & chr(34) & "\Microsoft\ScheduedTask1" & chr(34)
  .Run "schtasks.exe /change /s server1.domain.com /tn " & chr(34) & "\Microsoft\ScheduedTask1" & chr(34) & " /disable"
End With

Open in new window

0
 
sirbountyCommented:
Happy to help - thanx for the grade! :^)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now