On 4/30/06, Daniel Baird <danielbaird / gmail.com> wrote:
> On 4/30/06, Bill Guindon <agorilla / gmail.com> wrote:
> >
> > On 4/29/06, Lloyd Zusman <ljz / asfast.com> wrote:
> > > "Bill Guindon" <agorilla / gmail.com> writes:
> > >
> > > > On 4/29/06, Lloyd Zusman <ljz / asfast.com> wrote:
> > > >> "Bill Guindon" <agorilla / gmail.com> writes:
> > > >>
> > > >> >
> > > >> > 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 ... ???
> > > >>
> > > >
> > > > Same results.   Deleted the .bat file, and called it explicitly
> > > > (cdir.cmd) to make sure.
> > >
> > > Actually, I had to do this:
> > >
> > >   \path\to\ruby.exe cdir.rb instead of just cdir.rb
> > >
> > > I accidentaly copied and pasted the command line that I posted here from
> > > an earlier version that didn't work.  I'm sorry for the confusion.
> > >
> > Nope, that didn't help (yet).  Not sure that 'unfortunately' applies here
> > btw ;)
> >
> > > But I'm sure that this is do-able in windows, one way or the other.
> >
> > I'm inclined to agree, and thanks much for trying.  If nothing else,
> > you gave me food for thought, and a couple of search terms.
>
>
>
>
> a slightly less trickey way to do it (and apologies if this was already
> proposed, I've been kinda skimming this thread up til now) would be to call
> your ruby program from a cmd file, and call another cmd file right after.
> then your ruby program could re-write the second cmd file.
>
> like this:
>
> doit.cmd contents:
>     ruby myprog.rb
>     followup.cmd
>
> followup.cmd contents (written by myprog.rb):
>     cd c:\whatever\
>
> ..pretty sure this would work, if you can't get the originally proposed
> command line magic to work.  It'd work as .bat files too, so you could use
> it in Win98 or DOS or whatever.

Why was that so obvious _after_ I read it?  Thanks much.  Works like a charm.

> Cheers
>
> ;Daniel
>
> --
> Daniel Baird
> http://danielbaird.com (TiddlyW;nks! :: Whiteboard Koala :: Blog :: Things
> That Suck)
>
>

--
Bill Guindon (aka aGorilla)
The best answer to most questions is "it depends".