0

Ok first, yes, I know this will be looked at as a security risk.

The plan is to code this into an .exe; the pwd changes annually so there is very little hassle in changing the source code and re-compiling. And this will not be .Net where it can be de-compiled (at least not easily).

The current call is: CMD /C schtasks /Run /TN My_Task

And My_Task is set to run under a different account whether that account is logged on or not, using the "Run with Highest Privs" checkbox.

The goal--if you can suggest a more elegant way--is to just run this stinking task not on a timer but on-demand from a call by a program running on the server; this program allows "hooks" where you can put VB script at certain points in the vendor's code. So the schtasks isn't really needed, but I saw no syntax for VBscript to use a "/user someuser /pwd Somepwd" syntax, either way I'd code the vbscript call into an .exe to keep the pwd hidden from all but the most serious hackers.

Thank for any help.

jimo3
  • 101
  • 1
  • cmd /c schtasks /run /u /p /tn My_task – Larryc Aug 02 '20 at 02:23
  • Thanks @Larryc, I'd tried that, it says "Cannot specify user without specifying System". This is a domain account and I've prefixed with domain\, all my googling also seems show this syntax in the context of Creating, not Running, the task. It appears undocumented and doesn't show up in /? – jimo3 Aug 02 '20 at 13:15
  • "cmd /c SCHTASKS /Run /S system /U user /P password /I /TN My_task" That's from the help file if you run " schtasks /run /? " For I would include the domain just to be more specific. Something like "\\domain name\machine name" but if it don't fly then try it without. Good luck. – Larryc Aug 04 '20 at 08:30

0 Answers0