Op 20-7-2011 3:20, Rugxulo schreef: > You might need FreeCOM 0.84-pre2, I think. It has "set /e" (but needs > %TEMP% !!) and "cdd" works for "c:\path\blah.exe". Otherwise, you'll > have to hack up a quick tool or use something premade (DJGPP's > dirname.exe from Shell Utils [shl2011b.zip]) or similar.
Already using that. My intention is to switch to the directory where SETUP.BAT is located so I can run programs which are located elsewhere in the directory tree with it. One such program is FreeCOM itself. I wasn't aware SET /E requires a location to write. Suppose I have a SETUP.BAT at D:\ , thus D:\SETUP.BAT It shouldn't matter if I do: 1) D:\SETUP 2) D:\SETUP.BAT 3) D: ; SETUP 4) D: ; SETUP.BAT 5) D:SETUP (though I'd better be in correct dir on D: before) 6) D:SETUP.BAT 7) SET PATH=%PATH%;D:\ ; SETUP 8) SET PATH=%PATH%;D:\ ; SETUP.BAT 9) D: ; \SETUP In all cases I want SETUP.BAT to be able to switch current directory to whereever this file SETUP.BAT itself is contained, thus D:\ > I'm not exactly sure I understand the issue, but that's as good as > guess as I can offer without knowing more. (What are you trying to do? > Something from within another .BAT file?) I'm trying to switch into the FreeDOS installation CD directory tree, and make the batchfile bulletproof against other shells by simply loading FreeCOM. 4DOS is easy, and might be something I'll load then, followed by FreeCOM: set td=%@path[%_BATCHNAME%] CDD %td% set td= Writing entire installation procedures in 4DOS should be possible as well, just takes lots more research. My FreeCOM part looks like this now: set /E thisfile=truename %0 if exist %thisfile%.bat set thisfile=%thisfile%.bat if exist %thisfile% goto switchdir for %%x in ( %path% ) do if exist %%x\%0 set /U thisfile=%%x\%0 for %%x in ( %path% ) do if exist %%x\%0.bat set /U thisfile=%%x\%0.bat if exist %thisfile% goto switchdir echo Fail! The difficult part is Microsoft's command.com as it lacks a lot of variables and concurrent directory/drive switching. Just as the 1.44MB bootdisk I uploaded should work with FreeDOS 1.1 CD (but doesn't yet, in my uploads), so should any other bootdisk. ------------------------------------------------------------------------------ 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks & Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/ _______________________________________________ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel