0

I have make my Crud script for updating database from my Local Server to Internet, it run with batch file through Task Scheduler, the problem is Task Scheduler isn't create log file.

How can make my Server to create Log File with my batch file that run with Task Scheduler? I already created batch file with script :

cd E:\www\80\curl

c:\php5\php E:\www\80\curl\update_database.php >> result.log

But when I run it manually, it does create log file.

Please help me...

Community
  • 1
  • 1
Goon
  • 3
  • 1
  • 2
  • 1
    When your batch file is run by the Task scheduler, does it have the same permissions as you do? i.e. Is it permitted to write to the log file? Check the user it's being run as. –  Jul 17 '13 at 01:40
  • Yes it is, I set permission that task Scheduler as Administaror, and I log in as Administrator also – Goon Jul 17 '13 at 03:09

2 Answers2

1

Another suggestion is use a specific log file path like

>> "c:\mypath\result.log"
foxidrive
  • 40,353
  • 10
  • 53
  • 68
  • 1
    As an aside, the reason this works is that by default, system tasks run from the System32 folder - while this post is two years old, if OP were to go back and check his/her Sys32 (assuming the computer hasn't been reformatted), result.log would probably still be sitting there. – mdhansen Jul 09 '15 at 19:43
0

Replace cd E:\www\80\curl with cd /d E:\www\80\curl (or just add the line E:). By default, the cd command will change the current directory for the named drive yet not the current drive.

Community
  • 1
  • 1
PleaseStand
  • 31,641
  • 6
  • 68
  • 95