Scheduled Task: Batch File

jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Scheduled Task: Batch File

Post by jstevens »

I'm having a challenge running a scheduled task which triggers a batch file that maps a drive.

The batch file runs just fine but when I try to schedule it to run at log on it does not map the drive. I have the privilege set to run at the highest and the task is enabled. When in the task scheduler panel I can click on "run" and the event will trigger off and the status will change from ready to running. At this point the status stays on "running" and never completes.

Your suggestions are appreciated.
Regards,
John

User avatar
StuartR
Administrator
Posts: 12612
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Scheduled Task: Batch File

Post by StuartR »

Can you put a PAUSE statement at the end of the batch file and view the output
StuartR


jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: Scheduled Task: Batch File

Post by jstevens »

StuartR,

By adding a PAUSE statement does not change the end result other than requiring the user to "press any key to continue". Running that batch file from a scheduled task just hangs on the "running" status. Double clicking on the batch file does map the drive as expected.

If I recall earlier versions of Windows had a similar challenge. I'm on Windows 11.
Regards,
John

jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: Scheduled Task: Batch File

Post by jstevens »

StuartR,

I got it to work by deleting the questionable task and starting over. I create one to run when logged in. After viewing the scheduled task the status was in the "ready" mode.
Regards,
John

User avatar
StuartR
Administrator
Posts: 12612
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Scheduled Task: Batch File

Post by StuartR »

:shrug:
StuartR


jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: Scheduled Task: Batch File

Post by jstevens »

I am just as surprised as you. I'm glad it worked though.
Regards,
John