I have batch script file, which should encrypt a file with pgp. I have defined a task in task scheduler to do this, but I am keep receiving the error"The system cannot find the file specified".
Interestingly, when I run the same line of script in my powershell , the encrypted file is successfully generated.
I was wondering if anyone knows what can possibly be wrong here?
I tried to give the full path in my batch script , and also added the pass in start in part, when defining the action.
the batch scrip code is here::
rem @echo off @set path=c:\test;%path% @set d=%date:~-4,4%%date:~4,2%%date:~-7,2% @set d=%d: =_% @set t=%time:~0,2%%time:~3,2%%time:~6,2% @set t=%t: =0% Rem Generate PGP encrypted file @echo Starting PGP... >> c:\apps\ftpLogs\test.log gpg2 --batch --yes -r testkey --output c:\test\foo\test_20150505.pgp --encrypt c:\test\foo\test_20150505.txt >> c:\apps\ftpLogs\test.log and the script that I ran in my powershell, which works fine, is this line:
gpg2 --batch --yes -r testkey --output c:\test\foo\test_20150505.pgp --encrypt c:\test\foo\test_20150505.txt >> c:\apps\ftpLogs\test.log
echo CD=%CD%to the top of your script andpauseto the bottom; 2. Run the script from command line or double click: error? 3. Run the script from Task Scheduler. 4. Compareecho CD=%CD%output...