Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
Squashman
- Expert
- Posts: 4487
- Joined: 23 Dec 2011 13:59
#46
Post
by Squashman » 14 Oct 2017 15:53
So executing the batch file from a cmd prompt and from Windows Explorer says the parent process is Explorer.exe.
If I execute it from the cmd prompt like this.
It comes back with cmd.exe
When run from Task Scheduler it says the parent process is svchost.exe.
-
aGerman
- Expert
- Posts: 4703
- Joined: 22 Jan 2010 18:01
- Location: Germany
#47
Post
by aGerman » 14 Oct 2017 16:03
Squashman wrote:So executing the batch file from a cmd prompt and from Windows Explorer says the parent process is Explorer.exe.
Yes. If you used CALL in the cmd prompt no new process was created.
Squashman wrote:When run from Task Scheduler it says the parent process is svchost.exe.
One of the commenters at SO said the same. I didn't try to run it from a scheduled task. As I understood the comment it depends on the context the scheduled task was run. You could do some tests with the SYSTEM account or with your account but elevated.
Steffen