The following is the command to be run.
C:\Windows\System32\schtasks.exe /run /tn "WAU Manager"
The following "TargetPath" does not work because there are quotes inside the quotes.
Set A = CreateObject("WScript.Shell")
Desktop = A.SpecialFolders("Desktop")
Set B = A.CreateShortcut(Desktop & "\Testing.lnk")
B.TargetPath = "C:\Windows\System32\schtasks.exe /run /tn "WAU Manager""
B.Save
I have tried "chr(34)" in the following one, which does not work either.
B.TargetPath = "C:\Windows\System32\schtasks.exe /run /tn " &chr(34)& "WAU Manager" &chr(34)
The following ones do not work either. Doubling the literal quotes does not fix the problem.
B.TargetPath = "C:\Windows\System32\schtasks.exe /run /tn ""WAU Manager"""
B.TargetPath = """C:\Windows\System32\schtasks.exe"" ""/run /tn"" ""WAU Manager"""
B.TargetPath = """C:\Windows\System32\schtasks.exe /run /tn"" ""WAU Manager"""
B.TargetPath = "C:\Windows\System32\schtasks.exe /run /tn" "WAU Manager"
B.TargetPath = "C:\Windows\System32\schtasks.exe /run /tn" ""WAU Manager""
Const Quote = """"
B.TargetPath = "C:\Windows\System32\schtasks.exe /run /tn " & Quote & "WAU Manager" & Quote
How can I make it work?