Eric Auer schrieb: > Hi Michael, > >> I need a variable %bootdevice% (or w/e) pointing to the current >> session's boot device (A:\ or C:\). > > Nice :-) > >> Is there such a variable or can you tell me how to set >> this variable automatic in batch? > > I do not remember one, but it is extremely easy to do: > > Run the bootdev.txt file shown below once: > > a cs:100 > mov ax,3305 > int 21 > add dl,40 > mov [0118],dl > mov ah,09 > mov dx,0118 > int 21 > mov ax,4c00 > int 21 > db "?:",0d,0a,"$" > > r cx > 1d > n bootdev.com > w > q > > Note the empty line before "r cx". > > X:\>debug < bootdev.txt > ... > Writing 001D bytes. > ... > > Now you can use the following command: > > X:\>set /e bootdevice=bootdev > > Bootdev.com simply prints a string like "C:",CR,LF > which is then stored in a variable, as you can see: > > X:\>echo %bootdevice% > C: > > FreeCOM and CMD support SET /E, not sure about > other / older command.com variants here. > > Eric > > PS: A similar trick can be done with my GETARGS tool > to fetch MEMDISK "Linux kernel options" (memdisk is > booted like Linux) into a variable inside DOS ;-). > >
On read-only media the 'set /e bootdevice=bootdev' will create an error due to write protection. How this can be solved? regards -mr ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ Freedos-user mailing list Freedos-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-user