1
votes

I'm running a batch file in windows 7 task schedular by giving the full path of the file.In batch file i have imported the index.php file.While i run the file Im getting the below error : 'pscp' is not recognized as an internal or external command, operable program or batch file. 'gunzip' is not recognized as an internal or external command, operable program or batch file. 'pscp' is not recognized as an internal or external command, operable program or batch file. 'gunzip' is not recognized as an internal or external command, operable program or batch file. note:pscp and gunzip are present at the path where batch file is present,then also im getting this error. Help me out to solve this issue .

1

1 Answers

4
votes

The problem is that the scheduler runs your bat with %WINDIR%\System32\ as working directory. To fix this issue just add CD /D %~dp0 at the beginning of your bat file. This will change the directory to the location of your bat file.