andrew Black wrote: > Hi > I am trying to write a program that will allow me to CD to various > places (more details later). I want to call this from the windows > command line (cmd). > > Ways I have tried are > - use Perl "chdir" - but this only affects the perl process. The > caller doesn't see that change. > - write a bat file that calls the Perl which somehow returns the > result back to the bat file that can then CD for you. How can you > return this > REM mycd.bat > perl find_dir.pl %1 > cd %directory_returned_by_find_dir%
Did a little searching and came up with this to replace the above 2 lines : for /F "usebackq" %%i in (`perl find_dir.pl %1`) do cd %%i > > In a bit more detail as to what I am trying to do at application level. > I want to be able to type "mycd test" and this looks up test in a flat > file and finds > test : c:\blah\blah\moreblah\test > and cds you to the correct directory > > Any thoughts as to how to do this -- ,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED] (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff) _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs