Hi, On Thu, Jul 21, 2011 at 1:34 AM, Bernd Blaauw <bbla...@home.nl> wrote: > 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.
I can't remember if 0.82pl3 even supports that. Like I said, I never use 0.82pl3, only newer 0.84-pre2, but some people still prefer it. > 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:\ Is the problem that we don't know what drive the CD will be assigned? 'Cause I (dumbly) was thinking, "Well, he knows it's D:\, so he should just 'set SETUP=D:\' in the .BAT". I guess a silly "for %%a in (c d e f g) do if exist %%a:\setup.bat set SETUP=%%a" is probably out too, hmmm? ;-) Bah, confusing. A standalone tiny util for this purpose would probably work better. I also had written a silly WHATDRIV.COM util used on one of my floppies, but I can't remember why. Maybe I was expecting someone to convert to .ISO (mkbiso) or whatever. Not sure if that would help here or not. > 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. For sure 4DOS is more useful, but it might be overkill here. I don't know if Jim would prefer FreeCOM exclusively instead or not (though I probably would). > 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! Looks good, mostly like I would do. Be aware that "for %%x in ( %path% )" won't work in 4DOS (last I tried), nor Win32's CMD (worse, probably due to LFNs and/or spaces). > The difficult part is Microsoft's command.com as it lacks a lot of > variables and concurrent directory/drive switching. Variables such as what? I'm not sure why you'd try using their shell here, perhaps installing from within Windows?? I think Win32's CMD.EXE supports "%CD%" instead of "%_CWD%" and "cd /d" instead of "cdd", if that's what you meant. > 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. Good luck! (Sadly I'm not much use testing right now, though I did manually install FreeDOS the other day and auto-installed PuppyLinux. Yeah, even my other P4 computer now has PSU problems [randomly turning on and off], so I'm back to this new one, where Windows hosed itself. Sometimes I hate computers.) ------------------------------------------------------------------------------ 5 Ways to Improve & Secure Unified Communications Unified Communications promises greater efficiencies for business. UC can improve internal communications as well as offer faster, more efficient ways to interact with customers and streamline customer service. Learn more! http://www.accelacomm.com/jaw/sfnl/114/51426253/ _______________________________________________ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel