Getting blank (black) screenshot with automated screen capture using task scheduler
===

I am trying to troubleshoot a software bug in which we think an app may not be launching every time it is called. To test this, I created a series of scheduled tasks to launch the app, take a screenshot, and then close the app. These tasks are all run through .bat files.

Everything works fine except for the screenshots. When run as a scheduled task, the .jpg from the screen capture always shows a black box. If I execute the .bat file normally, the screenshot looks fine.

I am using nircmd to send the screen capture command and save it to a folder. The command I am using is as follows:

nircmd.exe savescreenshot "C:\File Path\"~$currdate.MMddyyyy$-~$currtime.HHmmss$.jpg

I am using Window 7.

Thank you in advance for your help.