From: bdezonia@... Date: 2007-11-09T03:30:26+09:00 Subject: Re: Windows: Scheduled Ruby script won't run On Nov 8, 10:37 am, Mohit Sindhwani wrote: > Michael Gaunnac wrote: > > On Nov 7, 2007 1:35 PM, wrote: > > > The attached file contains the parts of a Scheduled Task that reports > > a restart of a Windows OS instance through email and any errors > > associated with Terminal Services. The parts are separated by dashes. > > This may be more than what you are looking for but it contains some > > hard won information. > > Hi, I'm not sure and I can't tell much from the script without trying it > out. Could you try something? In your .cmd file, can you do a chdir to > the directory in which it's supposed to run. Do the same for the Ruby > script also. See if that helps. > > Cheers, > Mohit. > 11/9/2007 | 12:37 AM. 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.