From: Lloyd Zusman Date: 2006-04-30T09:38:37+09:00 Subject: Re: can a ruby script perform a chdir on win xp? "Bill Guindon" writes: > On 4/29/06, Lloyd Zusman wrote: >> Lloyd Zusman writes: >> >> > [ ... ] >> >> Correction: >> >> > @echo off >> > for /f "usebackq" %%i (`my-ruby-prog.rb`) do cd %i >> for /f "usebackq" %%i (`my-ruby-prog.rb`) do cd %%i > > I like the look of it, but it's not working here: > > c:\work\active\apps>cdir.bat > (`cdir.rb`) was unexpected at this time. Hmm ... I wonder if this needs to run in a .cmd file instead of a .bat file. Under winxp, it works for me in a .cmd file exactly as written. Maybe if you rename your file to be cdir.cmd ... ??? > cdir.bat: > -------------------- > @echo off > for /f "usebackq" %%i (`cdir.rb`) do cd %%i > -------------------- > > cdir.rb: > -------------------- > cwd = '\windows' > puts cwd > exit(0) > -------------------- -- Lloyd Zusman ljz@asfast.com God bless you.