Hide scheduled task PowerShell launches
This commit is contained in:
parent
f7763bf306
commit
aada991fb7
3 changed files with 28 additions and 4 deletions
20
scripts/run-hidden-powershell.vbs
Normal file
20
scripts/run-hidden-powershell.vbs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
Option Explicit
|
||||
|
||||
Dim shell
|
||||
Dim command
|
||||
Dim i
|
||||
Dim exitCode
|
||||
|
||||
Set shell = CreateObject("WScript.Shell")
|
||||
command = QuoteArg(shell.ExpandEnvironmentStrings("%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe"))
|
||||
|
||||
For i = 0 To WScript.Arguments.Count - 1
|
||||
command = command & " " & QuoteArg(CStr(WScript.Arguments(i)))
|
||||
Next
|
||||
|
||||
exitCode = shell.Run(command, 0, True)
|
||||
WScript.Quit exitCode
|
||||
|
||||
Function QuoteArg(value)
|
||||
QuoteArg = """" & Replace(value, """", """""") & """"
|
||||
End Function
|
||||
Loading…
Reference in a new issue