From: Mohit Sindhwani Date: 2007-11-09T03:55:44+09:00 Subject: Re: Windows: Scheduled Ruby script won't run bdezonia@wisc.edu wrote: > Okay, here is a test script/cmd combo that runs from the command line > but not from a Scheduled Task under Windows. It results in an error > code of one. > > ##### blunk.cmd file > > c: > cd \scripts > c:\ruby\bin\ruby.exe c:\scripts\blunk.rb > > # I have tried using the env variable idea earlier with no different > outcome > > ##### blunk.rb file > > PATCHFILE = "c:/scripts/patchDayNotice" # also without absolute path > tried and failed > > File.open(PATCHFILE,"a") do | file | > file.print("BLUNK called\n") > print "BLUNK called\n" > end > > Any help anyone can give would be great. Is the error return code of > one from Ruby? What error is that? I can't find any info on that. > OK! I just tried the cmd/ rb that you sent me. Yes, it works fine from the command line. I also set it up as a 1-time task in Windows scheduler [you'll understand why I didn't set it to be something that runs only on bootup] and it just ran from Windows scheduler. It seems to work fine for me. It appends to the file. I did not set any advanced properties in Windows scheduler. Now, I'm lost as to what may be causing the problem for you. Cheers, Mohit. 11/9/2007 | 2:55 AM.