PDA

View Full Version : set TEMP



mnovak5
07-02-2001, 11:00 AM
Hi!
I'm all new to scripting issues so I need some help. I have two harddisks (one is the mobile rack). I'm asking about setting the temp directories (ideally also virtual memory for Windows 98):

How to:

1. If only C drive is present (default setting) set the TEMP and TMP directories to C:\Temp

2. If also D drive is present set these directories to D:\

The system autodetects the other drive in BIOS. Is it possible to do "the same" with this? I have no idea about the symbols autoxec.bat is using.

P.S. The CD-ROM drive is set to H:\ regardless of the other disk present.

Thanks,
Michael

RWSchlatter
07-02-2001, 10:07 PM
"...I have no idea about the symbols autoxec.bat is using. ..."

From your installation cd copy the contents of directory \TOOLS\OLDMSDOS\ to your C:\WINDOWS\COMMAND directory. This will especially add the MSDOS help file.
Double-click the HELP.COM file, you will get a charater-mode windows-like interface listing the possible commands in MSDOS, usable in either CONFIG.SYS, AUTOEXEC.BAT or at the MSDOS prompt.
Depending on your setup, the mouse may not work, so use the tab / shift-tab to move thru the options, Pg-Up / PgDn to scroll, Alt to move to the menubar.

"...Is it possible to do "the same" with this? ..."
put following commands into your autoexec.bat to dynamically set the path for the temporary directory:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<pre>rem --- dynamic temp directory reference -----
echo testing d-drive &gt; d:\xyzxyz.xyz
if exist d:\xyzxyz.xyz goto d_exists
rem without d: drive
set temp=c:\temp
goto more
:d_exists
set temp=d:\temp
del d:\xyzxyz.xyz
:more
rem ------------------------------------------</pre>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comments:
with the echo command we display some text "testing d-drive" (or whatever you like) and redirect the output using &gt; to a file (any choosen name, take care not to overwrite some important data!). If the drive D: does not exist, the echo command may display a message, but completes without further error.
with if exist we test if we still can see that file, and branch off to label d_exists. Else the control flow runs to next line.
remainder of BAT file should be clear to you.


______________
Regards - Richard