Platinum Partner

How To Run A Powershell Script From A Scheduler

// the following script will hide a CMD window if a PowerShell script is run in Windows scheduler

Dim objShell,objFSO,objFile

Set objShell=CreateObject("WScript.Shell")
Set objFSO=CreateObject("Scripting.FileSystemObject")

'enter the path for your PowerShell Script

'verify file exists
If objFSO.FileExists(strPath) Then
'return short path name
    set objFile=objFSO.GetFile(strPath)
    strCMD="powershell -nologo -command " & objFile.ShortPath

    'Uncomment next line for debugging
    'WScript.Echo strCMD
    'use 0 to hide window
    objShell.Run strCMD,0


'Display error message
WScript.Echo "Failed to find " & strPath
End If

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ }}
{{ parent.authors[0].realName ||}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks