Return to AskMe Archive Main Page
Return to Main PowerUsers.info Main Page
----------------------------------------------------------------------PowerUsers.info - Paul Doherty Askme Archive of Questions and Answers
QAId : 6865113
Asker : max1milion
Subject : Writing dos batch files
Private : No
Question : I want to write a batch file that uses a part of itself only if a
variable has a certain content. If I simply enter into a batchfile
dir %1 /s
for instance, then the input to run the batch file at the prompt would be
batname searchterm
and it works fine. BUT, if I want to make the switch a variable it would look
something like this
dir %1 /%2
and the prompt input would look like this
batname searchterm s
and IN THEORY it would work fine. BUT, if I want to use that batch file to run a
search WITHOUT any switches, then it doesn't work, because it still puts in the
slash. Example
batname searchterm
when using the batch code
dir %1 /%2
will produce
dir searchterm /
and screw up because of the erroneous /.
How can I set up my batch file such that it only puts in the / if there is a
variable to follow it? Better yet, how can I tell the batch file to return some
kind of an echo message if a variable's content is wrong? Is this even possible?
Any help would be much appreciated.
max@nerc.com
Answer : You can check for the second parameter like this:
@echo off
if '%2' == '' goto noparam
dir %1 /%2
goto exit
:noparam
dir %1
:exit
If the second parameter spot is empty you will perform the normal dir command;
if it's not empty you will use the value there.
As for checking for legit values, you can do so with successive tests as above.
For example let's say that only "a", "b" or "c" are to be accepted as valid
entries for the second parameter position. You can then validate the input as
follows.
if '%2' == 'a' goto valid
if '%2' == 'b' goto valid
if '%2' == 'c' goto valid
goto error
:valid
dir %1 /%2
goto exit
:error
echo You need to enter a second parameter of a, b, or c!
:end
*Any* successful test above short-circuits by jumping to the "valid" branch. If
it gets past all the tests of valid parameters without a match then the error
code will be executed. Be aware that you may want to test for BOTH lower and
uppercase letters, like:
if '%2' == 'a' goto valid
if '%2' == 'A' goto valid
Have fun!
--
Paul Doherty
http://members.home.net/iqueue
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 6874120
Asker : Anonymous
Subject : Xcopy
Private : No
Question : How do use the xcopy dos command, that will alert me that floppy disk
space has run out and to insert another disk to continue?
Answer : xcopy does that by default. Just issue a command like this with a blank
floppy in the drive:
c:
cd \windows
xcopy *.bmp a:\
When the disk is full it will prompt you to put in another.
--
Paul Doherty
http://members.home.net/iqueue
DOS/Windows Utilities
Rating : 4
Answer : What version of Windows or DOS are you using? Under Windows 2000 is
automatically prompted me for another disk. There is no switch to cause it to
occur so if your version doesn't work you may want to try and find a newer one
on a search engine like google or ftpsearch.lycos.com.
--
Paul Doherty
http://members.home.net/iqueue
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 6937276
Asker : Anonymous
Subject : DOS CD Command
Private : No
Question : I tried to run one of my programs (recommended by the software
company) in DOS, but got the error message “invalid command”. I then tried to
change directories with no luck, using the DOS CD command. I could not change to
my “Program Files” directory using the syntax “CD Program Files” from my C:\
prompt, which is the next subdirectory above the C:\. I get the error message
“Too many parameters”? I could change to the Windows directory just by typing
“windows” but not anything else? Why? I'm running windows 98 se and restart in
DOS mode to do this.
Russ
Answer : This problem stems from the fact DOS uses whitespace (spacebar press,
tab character, etc) as a delimiter, which simply means spaces are a separator
for DOS to distinguish between what is a command (cd) and what are the
parameters that follow it (Program Files). The problem here is that the CD
command's syntax looks like this:
cd <path>
("cd" by itself will show your current directory)
So the CD command expects only one parameter to be given to it - and that
parameter should be a valid DOS path; either an absolute path like c:\dos\mystuff
or a relative path (meaning starting from your currect directory on the
filesystem) like dos\mystuff
What you told CD was this:
CD Program Files
Which in essence makes no sense according to the CD syntax above since there is
a space between "CD" and "Program" and another between "Program" and "Files". So
CD sees *two* parameters being given it instead of the single one it wants and
dies. What you need is to force DOS to ignore the fact there is a space between
"Program" and "Files" and to treat the space as a non-special character. This
will defeat the normal delimiter function and allow the whole path to work as
you intend. To do that we use double quotes around the item that contains a
space:
cd "program files"
And voila! You are in!
--
Paul Doherty
http://members.home.net/iqueue
DOS/Windows Utilities
FUQuestion : Paul,
Thanks for the reply. Tried your method, cd "program files" syntax. No such
luck. Got error message, "no directory exists". In the process I did discover
what does work. After running the DIR command I realized all my Windows 98se
names are truncated under DOS. So, "program files" subdirectory really becomes
"progra~1", which I can change to without quotation marks.
Thanks for the try,
Russ
Answer : It wasn't a "try", it was 100% accurate. It just doesn't apply in DOS
mode outside of Windows. Try it yourself and see - if you type:
cd program files
you'll still get an error.
If you type:
cd "program files" it will work.
I'm glad you figured out that long filenames get truncated. You don't need to
exit to DOS mode to run the app, however. Windows 98SE will run most DOS apps
right inside a window. Open a DOS prompt (Start/Programs/MS-DOS Prompt) and cd
as I showed you. Then run your app (can press ALT-ENTER to toggle between full
screen and windowed).
--
Paul Doherty
http://members.home.net/iqueue
DOS/Windows Utilities
Rating : 3
End :
----------------------------------------------------------------------
QAId : 6960520
Asker : whiplash415942
Subject : batch files
Private : No
Question : I have norton systemworks and I want to create a batch file that will
run like say norton disk doctor,complete it,then run norton windoctor,complete
it, etc.
but my batch files only open the interface, they don't start the program.I want
to be able to run multiple programs one right after the other with no
interaction from me. How do I do this?
thank you for your time.
Answer : Your apps probably are only opening and not acting because you're
running them "plain". That is, without any parameters being given to tell them
what to do.
To find the switches (parameters) your app supports:
http://www.symantec.com/search/
Type in:
command line switches
and hit ENTER. You can find out the switches for each app that way, or you can
run the EXEs from a DOS prompt with a "/?" after them to find the switches,
like:
ndd.exe /?
As for having your BAT file perform several of these tasks - you can run them
one after another in the BAT file, but if you need for any of them to finish
*before* running the next one (like a DiskDoctor to finish before a SpeedDisk
defrag begins) you can use a utility I wrote called Sequencer, available on my
website to cause your BAT file to wait until the apps you launch from your BAT
file finish their work and close before going on.
--
Paul Doherty
http://home.attbi.com/~iqueue
DOS/Windows Utilities
Rating : 4
----------------------------------------------------------------------
QAId : 6971248
Asker : brandonjohnson1
Subject : "End Process" Batch File
Private : No
Question : Hello All,
What is the command in a batch file to kill a process? The command needs to work
on 9.x, NT or 2K machines. When an app freezes, I want to be able to run the
batch, which will kill any remnant of the process and then restart.
Thanks!
Answer : For all three OS's my utility KillTask may help - http://home.attbi.com/~bitbucket911
For NT/2000 a utility called kill came with the Resource Kit - use another
utility tlist to find the PID (Process ID) number of each task before killing
it.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 6975234
Asker : pa.kinsella@...
Subject : renaming PC at Dos level
Private : No
Question : Hi,
Is it possible to change the computername at the DOS level, thereby alleviating
the need to go into windows/network/identification and changing it there. I am
imaging machines that are in the 98 platform. The most time consuming part is
having to go round and rename all the PC's once the imaging is complete.
thanks
Pat
Answer : Here is a conversation I found on this subject where the person is
using SysPrep with Ghost to image and give unique machinename/domain assignments
with a quick BAT file.
http://groups.google.com/groups?hl=en&threadm=%23uZlQP54AHA.2016%40tkmsftngp05&rnum=1&prev=/groups%3Fq%3Dghost%2Bunique%2Bmachine%2Bnames%26hl%3Den%26rnum%3D1%26selm%3D%2523uZlQP54AHA.2016%2540tkmsftngp05
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 4
----------------------------------------------------------------------
QAId : 6980596
Asker : Locii
Subject : Batch file
Private : No
Question : Hello all batch file gurus...
I collect text files in a directory. Periodically I need to append all these
collected .txt files to a single master file. What I'm trying to do is come up
with a batch file that will (1)append all collected .txt files to the master
file (2)not overwrite files already in the master file (3)erase the collected
.txt files from the directory. I've dinked around with the DOS command line
"copy file1.txt+file2.txt+file3.txt c:\whatever\master.dat" Just don't know
enough about batch programming to do the same thing with a batch file.
Any workable help will be appreciated.
Answer : In this instance we need to do more than one thing to each file in the
directory - the first thing is to concatenate (append) it to the master file,
and the second thing is delete each file as it's handled. So we need two BAT
files in addition to the "for" command. We start with TEST.BAT, which will
process all the files (I'm assuming TEST.BAT and NUKE.BAT are in the same
directory with the text files - if not just put the full paths on each command,
or a CD command at the beginning):
TEST.BAT
@echo off
for %%i in (*.txt) do call c:\windows\temp\test\nuke.bat %%i
ren newfile newfile.txt
Notice we use the "call" syntax since we need to execute a second BAT file from
within the first. We also pass it the current filename as we run it.
Now here is the NUKE.BAT BAT file:
NUKE.BAT
@echo off
echo Got parameter %1 in nuke.bat
type %1 >> newfile
rem del %1
The "echo" line is for debugging and can be removed if you like silence. Also
remove the "rem" from the last line to have it actually perform the delete of
each file after it's been appended.
Note that after TEST.BAT has processed all the files through the for loop that
it renamed the file NUKE.BAT was using the whole time as the repository for the
files (which was avoiding using a .TXT extension since it would then be included
in processing!) from NEWFILE to NEWFILE.TXT, completing the migration of the
text from all the text files residing in the directory to this new text file.
The file doesn't have to be new either, you can easily be appending to a
continuous master file that doesn't even need to be in this directory; just
change the path to NEWFILE in NUKE.BAT:
type %1 >> c:\wherever\masterfile.txt
My files in the beginning were 1.txt, 2.txt and 3.txt which contained the
following:
C:\WINDOWS\TEMP\test>type 1.txt
sdafasd
C:\WINDOWS\TEMP\test>type 2.txt
zxsdds
C:\WINDOWS\TEMP\test>type 3.txt
dsgasagrwe
After processing, newfile.txt contains:
C:\WINDOWS\TEMP\test>type newfile.txt
dsgasagrwe
sdafasd
zxsdds
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 6990535
Asker : ste_petrov
Subject : monitor driver
Private : No
Question : Hello,
Could someone tell me how to install
a monitor driver, which is an .inf file in DOS!
Thank you
Answer : That's not possible since a monitor INF file is not a driver, but just
a text file containing the technical specifications of the monitor (horizonal
and vertical sync rates, etc). All a monitor INF file does is tell Windows what
the monitor can do, so Windows and the video card driver can calculate the
proper resolutions and refresh rates for it.
DOS only uses its standard low-res screen until an *application* run on top of
DOS (like a game) itself sets up the video card for a different resolution/color
depth.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
FUQuestion : That's the problem as it was.
There were several computers connected in a network. One of them was very old
and by an unknown reason it was able to display only 16 colors. Through "Display
properties" I decided to find a better driver trough the network in one of the
others computers. After the restart the "old" computer displayed something in
many colors (the screensaver)
but the image was composed of moving left and right lines. There was no way to
guess what was actually on it. I've reinstalled Windows98, but the problem is
still there.
Could you please explain what happened and if possible find a solution.
Best regards,
Stefan
Answer : The chances are good that you've selected a monitor INF file that no
longer represents the true capabilities of your display. The symptoms you
describe of a garbled screen would be consistent with a refresh rate beyond what
the monitor can support. To change the monitor type or to change the refresh
rate to something lower reboot in Safe mode (hold the left CTRL key during the
reboot until a menu appears).
Safe mode will force you to boot in 16-color VGA mode where you can make the
changes. Once in, go to Start/Settings/Control Panel and select the Display
control panel. Go to the Settings tab and click thr Advanced button. Change the
monitor type under the Monitor tab, and set the refresh rate under the Adapter
tab. If the monitor were set correctly you would likely not have the problem you
describe so I would verify the monitor type first. Also ensure under Adapter
that you are using the right driver for your video card (at the top).
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
End :
----------------------------------------------------------------------
QAId : 7008112
Asker : sammy_lb_2000
Subject : Testing memmory in dos...
Private : No
Question : Hello paul,
can you please tell me how to test the computer's
main memory in the dos mode? Also, do you know of
any good Dos program that I can use to test the
memory for damage or defects?
thanks a lot for your help...!
sammy. ;-)
***
Answer : There are some memory testers here - I'm not sure which are the best.
My favorite way to test RAM to see if it is what is causing problems is to:
Create a RAM drive using RAMDRIVE.SYS or similar that is the total size of the
installed RAM minus about 512K-1MB (for your running DOS). Then once I've booted
with that RAM drive configuration I then do an:
xcopy c:\*.* x:\*.* /e
to copy the entire C: drive to the RAM drive. Of course it will fill up in short
order and abort, but that's just what you're looking for - a *clean* abort. If
the system just crashes or hangs your RAM is likely suspect. If it gracefully
tells you how dumb you are for trying to copy your hard disk to your RAM and
allows you to "Abort, retry, fail" then your RAM is likely OK.
This was an even better diagnostic for the system I devised this test for - the
Amiga - since it had a dynamically-allocating always-available RAM: device that
only took up as much room as what was in it. It was nice for this test since the
copy would literally fill all available RAM not currently occupied with running
code, unlike this one that neglects testing under the 512K or 1MB barrier.
Nonetheless this is a good way to test your RAM as chances are good (31/32 on a
32MB system and increasing as the size of your RAM increases) that the error is
not present in that lowest 1MB of RAM.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7012336
Asker : schn20
Subject : Filename
Private : No
Question : Hi. Can anyone tell me how to make a file name in dos that contains a
blank space. My teacher said that there is one way to do it. Thanks.
Answer : Sure thing - open a DOS prompt and type:
c:
cd \wherever
md hidden(ALT-0255)
where you see (ALT-0255) above is where you should press and hold the ALT key
and then type 0255 on the keypad at the far right of your keyboard. let go of
the ALT key and "space" will appear that isn't a space. To prove that all is
right try CDing to the new directory:
cd hidden
It will fail.
Now try it like this:
cd hidden(ALT-0255)
and it should work.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
FUQuestion : Thanks. Is this the same as saving a file with a space in it?
Answer : Not exactly, especially if you try to access the file or directory from
DOS. In Windows it will appear as a blank space, and since Windows is handling
the file/dir for you the effect is the same as a space. But in DOS you will not
be able to access, say this file:
c:\my file
as "c:\my file"
since the user will be typing a space (ASCII value different than the 255
character we used). Their access will fail with a "Bad command or filename" and
they won't know why.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
FUQuestion : Right. But is there a way to save a dosfile with a space in the
name? My teacher said that there is one way to do this only but he will not tell
us how.
Answer : All you want is a space? hehe Talk about (me) overengineering the
problem. I thought you were trying to be tricky.
Try:
md "stuff for me"
cd "stuff for me"
Enclosing it in quotes will do the trick.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
FUQuestion : I just have one more question. I'm just in the process of learning
dos right now, so please bear the dumb questions. When I'm making a directory
like what you told me above, I'm also making a file?
Answer : A directory is just a special file, that can have other files
associated with it (i.e. it points to all the files that are "in" the directory
after which its named). A truly irrelevant (to any end-user or power-user)
tidbit of info as it will never impact anything you do.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7020174
Asker : skyline77
Subject : how to?
Private : No
Question : how to inter to a certain folder in dos?
suppose the folder's name "aaa"
the line in dows appears like
D:\>WHAT SHOULD I WRITE???
Answer : cd aaa
Rating : 5
----------------------------------------------------------------------
QAId : 7028677
Asker : Sodea
Subject : File handles
Private : No
Question : I am using a dos application on Windows ME.
This application is two Databases which uses a software called DataEase, V4.53.
When after I open both databases and then try to access some data, I get a
message " not enough file handles".
In the past, This would happen when we would install on a new computer, so we
would go the the Config.sys and increase the number of handles to 200 and then
everything would be fine.
On Windows ME the Config.sys is empty, and furthermore when I enter "Files=200"
in config.sys and save it, it gets wiped out when I reboot the computer and the
contents in config.sys goes to "0".
Can you help me increase the file handles to be able to use these applications?
Answer : As you've noticed Windows ME doesn't use the setting in the CONFIG.SYS
- it's part of Microsoft trying to distance themselves from the DOS heritage of
Windows 3.1/95/98/98SE/ME. The setting that controls the number of file handles
in ME is kept in the C:\WINDOWS\SYSTEM.INI, under the [386Enh] section. If it's
not already there add the line:
PerVMFiles= number
where number is 225 or less (gets added to the default 30 file handles for a
maximum of 255).
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
End :
Rating : 5
----------------------------------------------------------------------
QAId : 7033868
Asker : Anonymous
Subject : Backup using DOS
Private : No
Question : I would like to backup a folder and its subdirectories using DOS
batch command. The one thing i want to be able to do is back up the folder only
if one of the files in it changes.
Here's what I have so far:
COPY H:\backup\email.zip G:\backup
COPY H:\backup\website.zip G:\backup
H: is a mapped directory on my laptop, G: is my backup partition.
Thanks for any help or suggestions.
Answer : To copy the whole folder and all its subdirectories you can use xcopy:
xcopy h:\backup\*.* g:\backup\*.* /e
This will get all files and folders from H:\backup
As for getting files after a change I can think of a few ways to approach that.
1) You can use the last changed date of the files to determine if they should be
copied. Then you can copy files newer than the specified date. Do a:
xcopy /? | more
to see your syntax for the /D: switch as it differs slightly from different
Windows versions.
2) Another way would be to use the archive bit that gets set by Windows/DOS
anytime a file is modified. To do that include the /M switch on xcopy to have it
copy only the changed files and reset those files archive bit:
xcopy h:\backup\*.* g:\backup\*.* /e /m
3) Do a:
h:
cd \backup
dir /s /a /-p > c:\before.txt
Now you have a directory listing of the full subdirectory structure, including
file sizes. Later, when you want to test if a change has occurred (new file
added, existing file changed size, etc) you can do this:
h:
cd \backup
dir /s /a /-p > c:\after.txt
fc c:\before.txt c:\after.txt
(note you will almost always see a difference in the summary information at the
bottom where the free disk space for the whole hard drive is noted so ignore
that difference)
If you see differences it's time to backup.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7033872
Asker : Modea
Subject : DOS variable in Windows2000
Private : No
Question : We switched from Windows 98 to Windows 2000 and two of the DOS batch
files, that we need to run, are not working.
In both cases we are calling the batch from a procedure in a DOS database.
The procedure in the database is supposed to assign values to variables in the
batch file.
Example of a batch file
pkzip %3 %2
The values that we are sending from the database are not being recognized. What
can we do to solve this problem?
Thank you for your time
Maureen
Answer : More examples needed of both batch files, what you expect to happen,
and what is happening.
FUQuestion : Hi Paul;
I may be able to explain it this way.
I have a Procedure that calls a batch file that zips files. The name of the .bat
file is MBBundle.bat.
The procedure reads
call program jointext("MBbundle Accounts",t_filesuff) This returns call program
MBbundle Accounts ZN0404
The Mbbundle.bat file reads pkzip %1 %2
So when the .bat file is called it would read
pkzip accounts ZN0404.
I hope this helps in your understanding of the problem and you know of a
solution.
Thanks again for your time
Maureen
Need More Information : Copy and paste your two scripts into a reply and then
show me an execution line.
Thanks
FUQuestion : The lines are exactly
The program line is
call program jointext("MBbundle Accounts",t_filesuff)
The execution line in the batch file is
pkzip %1 %2
I don't know what else I can tell you.
Answer : Instead of invoking the BAT file directly try invoking cmd.exe and
passing it the path and name of the BAT file, along with the parameters.
----------------------------------------------------------------------
QAId : 7033879
Asker : Anonymous
Subject : Compiling Problem in GWBasic in MSDOS.
Private : No
Question : Hi there,
I have a problem in compiling an old .bas GWBASIC file of 72KB using QBasic 4.5.
The error I am getting is "out of memory" & this is when I try to open the file
in QBasic 4.5. This compiler includes Brun45.exe. I know the compiler works
because I have successfully compiled smaller files. Also, the very same file has
been compiled in the past by others. Can anyone advise how I should proceed
please.
I would much appreciate any suggestions.
Regards,
Anonymous
Answer : If you are compiling under pure DOS (not DOS inside Windows) you may
try adding the following lines to your C:\CONFIG.SYS:
device=c:\windows\himem.sys
device=c:\windows\emm386.exe RAM
This will give you a memory manager resident and if your compiler can see and
use extended memory (above 1MB) you should be able to complete your compile.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
FUQuestion : Thanks but I am not sure what the difference is between compiling
under pure DOS & compiling in DOS inside a window.
I am in Windows95 & going to the MSDOS-PROMPT via the START button.
I have now managed to compile the file using QBASIC VERSION 2.0, after having
tried VERSION 1.1 & having had exactly the same problem & error report!!!
Strange???
I also tried adjusting memory settings from DOS properties but this had no
effect either.
Can you please explain the difference you mention & which of the two applies to
me. Thanks again.
Answer : The difference is where the memory settings reside. Windows, as you
already know, handles the memory for the DOS prompt in Windows. In DOS the
config.sys/autoexec.bat do.
FUQuestion : Hello again,
I would be interested to know if I could use MSDOS on my new computer in either
of the above modes. Unfortunately my new computer came with Windows ME installed
& I can see no obvious access to MSDOS. If MSDOS is there somewhere what version
will it be?
Thanks.
Answer : Microsoft made extra strides to remove DOS vestiges from ME, so getting
to a pure DOS prompt isn't as easy as in 95 or 98. You can try this procedure:
http://www.geocities.com/mfd4life_2000/
or just build a boot floppy from another 95 or 98 machine and boot from it
(Start/Settings/Control Panel/Add-Remove Programs/Startup Disk tab).
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
FUQuestion : Thanks for that but I am still not clear about how to work "in pure
DOS" as you put it in Windows 95. How do you do this as opposed to working in
DOS inside Windows 95 ( which I am clear about )?
Answer : On a 95 box reboot the machine and hold down the CTRL key until a menu
appears during boot. Select "Command Prompt Only" and you will stop in DOS
without loading Windows. That is the pure DOS mode I am referring to.
Rating : 5
----------------------------------------------------------------------
QAId : 7034151
Asker : GeneHackman
Subject : How to write to file in DOS
Private : No
Question : Hi,
I am trying to write the system's file list to one file through DOS.
Can you help me with it?
I am using Windows2000 machine.
Thanks a lot!
Answer : If by "system's file list" you mean all the files and directories on
the drive you can do this like:
open a DOS prompt
c:
cd \
dir /s /a > c:\filesdirs.txt
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7042792
Asker : doubletrouble65
Subject : deleting files in DOS
Private : No
Question : I have been told my system is slow due to having lots of unwanted
files in DOS How do I know which ones to delete and which to keep...
Thank you
Answer : "unwanted" is in the eye of the beholder. That aside TMP files are good
to get rid of. Do this to find them all:
c:
cd \
dir /s /a */tmp > c:\tmpfiles.txt
edit tmpfiles.txt
Now you have a list of every .TMP file on your system and it's path. You can
delete these for a start at cleaning up your hard disk.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7042802
Asker : anismdev
Subject : msdos setting
Private : No
Question : How can I fix an invalid msdos setting? "bootmenudelay"
Answer : Open a DOS prompt and edit the file like this:
attrib -r -h -s c:\msdos.sys
edit c:\msdos.sys
(here's an example of what it may look like):
[Options]
BootKeys=0
BootMenuDelay=0
BootMenuDefault=1
BootGUI=1
Add/change the lines to the values you want (site listed below that has all the
values and their meanings) and then save the file and exit with ALT-F
http://www.security-tips.com/008.htm
Rating : 4
----------------------------------------------------------------------
QAId : 7056977
Asker : jackie3101
Subject : ScanDisk
Private : Yes
Question : I took a class in Win98 several years ago. Until then, I didn't even
know what ScanDisk was. Anyway, I always agonized while using it because it
takes so long. I mentioned this to a tech where I bought my PC. This was a
couple years ago. He said, "Scan in DOS."
I didn't pursue it, but now I'm wondering. Is this possible?
(I could schedule these tasks, but I'd still wonder about this question.)
Thanks,
Jackie
Answer : Yes you can scandisk from DOS (not a DOS prompt in Windows). In DOS you
run "scandisk"; in Windows you run "scandskw". The best way is to use the
Windows Task Scheduler that runs in your systray in the lower-right of your
screen to schedule a weekly run of scandisk.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
FUQuestion : Thanks for the answer.
Is there any benefit to running one over the other?
Answer : Not really - though I'd expect the schedulable nature of the GUI
version in Windows would tip the balance.
Rating : 5
----------------------------------------------------------------------
QAId : 7059012
Asker : mercegov
Subject : DOS
Private : No
Question : When I start my computer with a boot disk
how can I shut down the computer and how can I
start Windows from there.One more question
how can I open help application in DOS
Thanks!
Answer : If you start from a boot disk (floppy) there is no need to shut down as
nothing is loaded but DOS (and DOS leaves nothing that needs to be cleaned up).
Starting Windows after booting from floppy is not generally a good idea,
although it may work. Booting from floppy makes A: your system disk and it won't
have what Windows is looking for. There isn't a help app in DOS anymore - you
cna get syntax help for each command by issuing the command with a /? after it.
Example using dir:
dir /?
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7069960
Asker : heshamsaad
Subject : stop others from using my files
Private : Yes
Question : hi, I want to stop the others from using my files and directories ..
I use this command :
(rename OLD_NAME NEW_NAME )and I add one charachter inside the new name by using
(ALT_key+8) 4 times..
so no one can open my directories.
but I want to learn some another ways to do that.
thanks.
Answer : How about naming a directory like this:
c:
cd \
md ALT+0255 (on the numpad)
Now you will have an "invisible" directory to put your files in.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7076764
Asker : bruced
Subject : DIR Command using /o switch
Private : No
Question : I have a question about the DOS command - dir. I sometimes use DIR to
generate a .txt file that lists all of the files in a given directory. I use the
following command line:
dir /b /o > list.txt
The /b command yeilds the brief form - only the file name.
The /o is supposed to put the files in the proper order (alpabetical??).
and the > list.txt generates a text file with the output in the subject folder.
Well, my problem is that the output order is sometimes correct and sometimes way
off. Most of the files that I am working with are almost the same, but with
sequestial numbers such as the following:
Jim_Bob_Test_system_analysis_part_1.txt
Jim_Bob_Test_system_analysis_part_2.txt
Jim_Bob_Test_system_analysis_part_3.txt
Jim_Bob_Test_system_analysis_part_4.txt
Jim_Bob_Test_system_analysis_part_5.txt
Jim_Bob_Test_system_analysis_part_6.txt
Jim_Bob_Test_system_analysis_part_7.txt
my problem is that many times my output is out of order like the following:
Jim_Bob_Test_system_analysis_part_4.txt
Jim_Bob_Test_system_analysis_part_7.txt
Jim_Bob_Test_system_analysis_part_6.txt
Jim_Bob_Test_system_analysis_part_5.txt
Jim_Bob_Test_system_analysis_part_3.txt
Jim_Bob_Test_system_analysis_part_2.txt
Jim_Bob_Test_system_analysis_part_1.txt
What can I do to get these output in the proper order. I sometimes have dozens
of files or more, so reordering them manually is a hassle and shouldn't be
necessary. I have started cut-and-pasting the list to Excel where I can sort
them easier, but I shouldn't need to do this either.
TIA,
BThomas
Answer : The "/o" alone should work for sorting (it defaults to folders first,
files second, with both sorted by name). Since it isn't working with these
extreme cases you can do this to list only files and get them in the order you
want:
dir /b /a-d | sort > list.txt
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7081781
Asker : adampengelly
Subject : Batch Files
Private : No
Question : Hi there. I'm cleaning out the LAN at work and am using batch files
to do most of the archiving and deletion of old stuff. My problem is that when I
run a DOS query, e.g:
dir O:\fadcom~1\share\fad\accounts /s /x >D:\a.txt
The directory summary is in the full name format, so that when I try and run the
batch file I create, It can't find any of the files in the long name
directories: e.g
O:\fadcom~1\share\fad\accounts\bank recs
as 'bank recs' is not a DOS name I think.
How can I change this, so that I can get the dir's in DOS format
Thanks
Adam
Answer : Just enclose the full name in quotes:
"O:\fadcom~1\share\fad\accounts\bank recs"
Rating : 5
----------------------------------------------------------------------
QAId : 7100817
Asker : sammy_lb_2000
Subject : Running a dos program in windows...
Private : No
Question : Hello paul,
in computer programming, if a Cobol program is
compiled and linked to produce a 32-bit Windows
Execuatable file(.exe), which is designed to run
under windows in protected mode, Can this windows
program(.exe) CALL OR RUN another 16-bit program
(.com) that is designed to run ONLY under dos?
thanks a lot for your help...!
sammy. ;-)
***
Answer : I would say almost certainly since every language I know of has the
ability to execute system calls or execute external apps. It's up to Windows to
provide the environment for the called program so the nature of the calling app
shouldn't matter.
If you're using Micro Focus COBOL you could look into using the X"91" (function
35) system call for running external programs. You may need to run either
COMMAND.COM or EXPLORER.EXE and pass the actual path/app along with it.
Rating : 5
----------------------------------------------------------------------
QAId : 7104723
Asker : kang_hsi
Subject : Uses for BATCH files?
Private : No
Question : Hello,
I just had a look at your website, and I was wondering what kinds of nifty
things Batch files are used for. I'm particularly interested in operating on
TEXT. For example, are there batch files that sort alphabetically the lines in a
txt file? Or, that generate oft-used HTML code so that it doesn't have to be
typed or pasted repeatedly?
Also, I've seen something on this board regarding running programs from within a
BAT. This may sound dumb, but what is the purpose? I mean, obviously one can
launch a program any number of ways, but why launch it in the middle of a batch
file?
I have other questions, but I'll post them under new subject titles in case
other readers want to link to them.
Much obliged,
Dave
==============================
Computer stuff: Gateway2000, Windows 98se (considering an upgrade to win xp or
maybe linux).
Brain: Lots of Internet experience, some programming experience, some DOS (but
the only thing I've done with batch files is delete cookies after surfing),
HTML..
Answer : Most people don't just run an app from within the BAT file - they're
usually launching an app from either a menu they've developed with their BAT
file, in response to some detected event, or as a way to iterate through a
repetitive process (like processing a large group of files one by one).
Try looking through some of the questions that have been asked of me and the
other DOS experts for good examples of real-world BAT files in use.
If you get really into text processing DOS is not the best tool for that - it
lacks a few tools to make it easier. I'd go with Perl or WinBatch
(http://www.windowware.com) for that type of activity.
Here are some examples of BAT utilities like mine that can give you an idea of
the range of tasks BAT files are useful for:
http://www.jumbo.com/utilities/dos/batchutl1/
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7119906
Asker : huge_angel
Subject : how to get dos under windows xp
Private : No
Question : hi i have install windows xp. on my computer and i want to work under
dos for embedded system.
does anyone know how i can get under dos. like in windows 95 or 98.
the old fashion dos.
thanks a lot
Answer : DOS does not exist in Windows XP, except as a command prompt *within*
XP. Running Start/Run/cmd.exe is as close to a true DOS prompt as XP has.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7125467
Asker : huge_angel
Subject : i need a hack to get into dos in win XP
Private : No
Question : well i know they was a crack for dos in win ME.
so can boot on dos.
well is their one for windows xp.
cause i need to work under dos for embedded control.
thanks a lot
Answer : No - Windows ME is still based on the Windows 9x (95/98) codebase and
has DOS at its core. Windows NT/2000/XP are all 32-bit protected-mode operating
systems and do not run DOS at their core. The only thing they have that
resembles DOS is their command-line intepreter, cmd.exe.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7125902
Asker : sammy_lb_2000
Subject : Detecting windows under dos...
Private : No
Question : Hello paul,
Is there a dos command that lets you know if the
windows operating system has been loaded, or the
machine still in dos mode?
thanks a lot for your help...!
sammy. ;-)
***
Answer : One way is to look for the presence or absence of a variable that
should only exist if Windows is loaded and running. The variable is WINDIR and
if it exists it contains the path to the Windows directory. You can test for it
similar to this (adapt the access to the environment variable's value for the
language you're using):
@echo off
if "%WINDIR%" == "" goto dos
echo Windows is running...
goto exit
:dos
echo Pure DOS is running...
:exit
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7132400
Asker : kang_hsi
Subject : Easy question: navigate to My Documents without renaming folder?
Private : No
Question : This should be easy for you all, it's a newbie question.
My DOS is getting rusty, but I know I used to simply hit start--run and type
'command' in Win98 and a DOS window would open in the very folder that I was
looking at (in Windows) before starting DOS.
My PC has been through some changes, and I upgraded to 98 special edition. The
DOS window still opens after I take the steps described above, but always in
C/Windows/Desktop.
When I try to CD to My Documents, it says 'too many parameters' because (i
think) there's a space in between the two words. I'm afraid to rename the
folder, but I KNOW I used to use the cd to get there in the past. How did I do
it?!
Looking for something like "MYDOC~", I did a recursive DIR from C/ and found
that not only was the "My Documents" directory not listed, nothing inside it
was. That's 98% of what I use?
Did I forget how it was done, or is my machine just messed up.
Many thanks,
kh
Answer : Just type:
cd "\my documents"
to enter that directory.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7138746
Asker : sabbakwa
Subject : DOS Command Box
Private : No
Question : I'd like to run a set of dos commands using a batch file without
having the black DOS command box show up.
Is that possible?
Answer : Yes - you can run it once (put a "pause" command in there so it doesn't
quit right away) and click on the top-left of the window. From the menu choose
Properties and set the window type to "Minimized". Also be sure to check the box
for "Exit when done". Now take the "pause" out of the BAT file and each time
it's run it will only show as an icon on the taskbar briefly as it runs.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 4
End :
----------------------------------------------------------------------
QAId : 7158710
Asker : Anonymous
Subject : dos//partitions again:
Private : No
Question : from fdisk when I delete the the logical partition it give me that
(no logical patition exist ).
then I try to delete the extended partition it me the message that (cannot
delete the extended
partiotn while the logical exist).
I use a utility from seagate for low level format and also zero fill drive but
the problem still
exist ??
Answer : Go download this utility and use it to delete the partition:
ftp://ftp.ncd.com/pub/ncd/Archive/WinCenter/Utilities/delpart.exe
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7179844
Asker : harvey48
Subject : Slow computer
Private : No
Question : I installed Window98 on a Compaq 954 (486DX100 with 32mb ram) which
had Windows 3.1 originally. Since then the computer runs very slowly especially
on the web. Would installing another 32mb ram help the speed? Or isn't this slow
speed a memory problem?
Answer : That's not a very fast computer, so even under the best of
circumstances you may not find it quick enough under 98. To determine if more
RAM is needed you can watch the HD light - if you see or hear the hard disk
running a lot (like at times when you are not doing anything yourself, like
downloading a program or loading something) then the system is likely swapping
out to disk and a RAM upgrade would help. If not then your system is probably
too slow for your needs under Windows 98.
If you want to be more precise about it try this free utility that will report
on how much memory is in use:
http://download.cnet.com/downloads/0,10152,0-10106-110-7355760,00.html?gid=87426&tag=st.dl.10106-100-7355760-7355760.dln.10106-110-7355760
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7190995
Asker : dish_jp
Subject : command line ftp client for win NT
Private : No
Question : hi pauldoherty !!
I have to do ftp from the pc on which raptor firewall is there to other pc where
linux os is there. But Raptor closes all the services. So I am not able to send
log files of raptor firewall to my pc for developing log file analyzer of raptor
firewall. That daily log file should come to my pc automaticalkly. so I am
trying to use ftp but it is giving error that
" 425 can't bind data connection: connection refused"
It is coming bcoz of raptor firewall I think. bcoz I have tried this with
Gauntlet firewall and without firewall to my pc on them it is working finely.
can u suggest any command line ftp client which does not use system files and
can send log file to my pc from raptor firewall. ?
or
Can u suggest any other solution for fetching daily log files to my pc ? but it
should come automatically to my pc. Raptor firewall is on Windows NT. My pc is
having Linux os.
Plz suggest any solution as early as possible.
plz mail answer me on
dish_jp@yahoo.com
Thanks
Jagdish
Answer : NO FTP client will work in your current situation as you have said, you
are blocking FTP ports 20 and 21. You will simply need to add a firewall rule
near the top of your ruleset to ALLOW TCP traffic on ports 20 and 21 to/from the
IP address of the machine you want to FTP the logs to. then you can use any FTP
client you like (like my own FTPBatch available at my website below) - or just
use the FTP.EXE that comes with Windows.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 4
----------------------------------------------------------------------
QAId : 7193389
Asker : Anonymous
Subject : opening a program
Private : No
Question : wat is the source code for opening a program in every start up in
windows by using batch. thanx
Answer : I assume you mean to start a program from a batch file when Windows
starts?
If so then make a BAT file (I'll call mine startup.bat) and save it to
C:\WINDOWS
It can look like this:
@echo off
start "c:\program files\myapp\myapp.exe"
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
Answer : I'm sure you've figured it out by now, but I realized I forgot to
mention thart after creating the BAT file, you'll want to create a shortcut to
it in your Start menu under Start/Programs Startup.
----------------------------------------------------------------------
QAId : 7198794
Asker : bentonb
Subject : batch files
Private : No
Question : I am using Win 95 as an operating system. I want to develope a batch
file that when executed, it would add a shortcut visible to the operator's
Desktop.
Example:
Target Application for desktop shortcut is RMA Log.mde. SHORTC~1.LNK REFERS TO
THE DOS SHORTCUT.
Path: \\R61SRV1\NCPM\"P I & T"\SHORTC~1.LNK C:\PROFILES\"ALL USERS"\DESKTOP\*.*
/D
The problem I'm having is the file gets copied to the Desktop folder under
Profiles but does not appear on the desktop itself.
Answer : Try it this way:
Path: \\R61SRV1\NCPM\"P I & T"\SHORTC~1.LNK "C:\PROFILES\ALL USERS\DESKTOP\*.*"
/D
You don't want the quotes around just the "all users" portion - it goes around
the whole path/filespec.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 4
----------------------------------------------------------------------
QAId : 7203825
Asker : dr_gabster
Subject : mapping drives
Private : No
Question : we have a Dos 6.22 pc. we would like to map a drive from our NT
SERVER 4.0 to this Dos pc. can you please tell me what command we should use?
please reply
gabe
Answer : First thing you need is to setup the DOS machine to get on the network.
Once it's on you'll use this syntax to map a drive:
net use T: \\server\sharename
For assistance with getting the machine on the network in DOS:
http://www.bovistech.com/disks.htm
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7220215
Asker : john_dun
Subject : dos
Private : No
Question : this might sound like a stupid question. How do you re-start the
computer from dos??
Thanks.
Answer : You make sure no one's looking, no app is currently open and needing to
save data, and then...
you press CTRL-ALT-DEL.
:-)
(no, seriously)
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7251853
Asker : martyn80
Subject : Simple DOS question
Private : No
Question :
If I run a java program at the MS-DOS command line, e.g "java Filename
argument", how can I display the output one screen at a time?
Thanks.
Answer : "java filename argument" | more
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7255582
Asker : crazy_shadow
Subject : Network Neighborhood Through DOS
Private : No
Question : hello,
does anyone know a way to access and folder in the Network Neighborhood through
DOS?
Answer : Assuming you mean a DOS prompt under Windows you can type:
net use X: \\machinename\sharename
and drive letter X: will be mapped to the path you give.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7273658
Asker : cliveroberts34
Subject : dos drivers for sound card
Private : No
Question : I am trying to install 'extreme tennis'by 'head games' & I need 'dos
drivers to operate dos shell thro. windows.
your help appreciated
Answer : There are no sound drivers for DOS - programs in DOS generate their own
sounds and support their own select group of sound cards. To play a DOS game
either in Windows (DOS box) or in pure DOS mode will require that you have a
card compatible with the game and that you setup the proper environment
variables to support the card. One of the most important variables is the
BLASTER variable which is set with the following syntax:
SET BLASTER=A220 I5 D1 T3 P330 H6 E620
where:
A220 is the I/O address
I5 - is the IRQ (5 in this case)
D1 - is the DMA channel (1 in this case)
T3 - is the card type (try different values here 1-7)
P330 - is the MIDI port I/O address (leave this alone - no need to change it)
H6 - is the "high" DMA channel (6 in this case)
E620 - is an AWE32 soundcard parameter only and can be ignored
This variable is accessed by the game when it starts up so it knows where to
look for your sound hardware.
You can get the proper values for your card in the System control panel, under
the Device Manager tab. Find your sound card in the list and double-click it. In
it's Resources tab you will find these values.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
End :
----------------------------------------------------------------------
QAId : 7289010
Asker : mtecarlo
Subject : Set up a printer for use with a DOS program on a personal computer
Private : No
Question : Have old version of DOS accounting software (Dac Easy). printer is
Epson Action Printer 5000 ESC/P2 (dot matrix). Software manufacturer would not
support product because of it's age.
Answer : Just choose a generic printer type within the app. You may lose some of
the features but you should get the output you need.
----------------------------------------------------------------------
QAId : 7289127
Asker : javalex
Subject : colors in dos
Private : No
Question : I'd like to be able to make a batch file that will show text in
different colours at different parts of the screen. Long ago there were complex
sets of routines for this. Also, I've forgotten how to make text appear at
different parts of the screen, eg to start printing at line 12 character 40. How
to you get "Hello" to appear in this position? And make it print in green.
Is there a source of all DOS commands on the net?
Yassou!
Answer : You will need to load the ansi.sys driver during boot. If you're
running DOS, Windows 95/98/ME you can include it in C:\CONFIG.SYS as follows:
device=c:\windows\command\ansi.sys
Once you've booted with this you can then start using the ANSI sequences to
change colors, move the cursor, etc.
For example to change your prompt at DOS to a red background with green text:
PROMPT=$e[41;32m$p$g
The sequence '$e[' is the escape sequence that gets ansi.sys involved. See the
following web page for info on the other parameters you can use:
http://www.robvanderwoude.com/ansi.html
As for a reference of DOS commands, here's a good one:
http://www.easydos.com/dosindex.html
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7294304
Asker : classicgto1
Subject : autoload @ bootup
Private : No
Question : I'm reading up on DOS and I tried something and it worked! I created
5 MENU files called 1.MSD 2.MSAV 3.SCANDISK 4.DEFRAG and 5.EXIT. These AUTOLOAD
at bootup, one after the other. I'm trying to set it up to have each one load
one at a time so I have to push the enter button to make it go to the next one.
How do you do that?
thanks, Jim
Answer : Try putting this in between each execution line:
echo Press ENTER to continue...
pause > nul
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7308834
Asker : yendreck
Subject : invalid drive specification
Private : No
Question : I'm trying to access my cd-rom drive from MS-DOS, but my hard drive
is partitioned, so that makes the cd-rom drive letter "F:". While in DOS, I can
access drives A: through E:, but not F:, which is the cd-rom drive. When I try
to, a message says "invalid drive specification". Is there any way I can access
my cd-rom drive from DOS?
Answer : OK - make a boot floppy (on your or another windows machine) as
follows:
Start/programs/MS-DOS prompt
(put a blank floppy in the drive)
format a:
c:
cd \
sys a:
copy windows\himem.sys a:\
copy windows\smartdrv.exe a:\
copy windows\command\mscdex.exe a:\
copy windows\command\xcopy*.* a:\
copy windows\command\format.com a:\
copy windows\command\edit.com a:\
copy windows\command\sys.com a:\
Download the following file to a:\
http://home.attbi.com/~bitbucket911/idecd.sys
Now create a config.sys as follows:
edit a:\config.sys
The config.sys needs the following in it:
device=\himem.sys
device=\idecd.sys /d:cdrom001
Save the config.sys
Now edit a:\autoexec.BAt and put the following in it:
@echo off
\mscdex.exe /d:cdrom001 /l:f
\smartdrv /n c+ f 4096 4096
Save the file and exit.
Now test the disk and ensure it boots and brings the cd-rom drive up
successfully as letter f.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
FUQuestion : My computer used to check to see if there was something in the A:\
drive when it booted up...now it doesn't do that anymore, it just goes straight
to Windows. How can I make it so that it checks the drive when it boots up?
Answer : During the beginning of a cold boot (from power up) watch for a message
about "press Del to enter BIOS Setup" or something similar. Press the indicated
key to enter and there will be an option in there about what order to boot from
- ensure that A is first and C is second. That aside try booting from the floppy
first before deciding it's not going to boot - the "floppy seek" may have been
turned off but it's still set to boot from A.
Rating : 5
----------------------------------------------------------------------
QAId : 7324791
Asker : mgalke
Subject : how do I view contents of config.sys and autoexec.bat
Private : No
Question : As the subject implies, can you tell me what text editor (or even
through a text editor at all) should I use to view to contents of config.sys and
autoexec.bat? Thanks!!
Answer : Several ways to view or edit it:
In Windows:
Start/Run/Notepad - file/open c:\config.sys
Start/run/msconfig
In DOS:
edit c:\config.sys
type c:\config.sys
more c:\config.sys
autoexec.bat is stored at the same path, so just change config.sys anywhere
above with autoexec.bat to view it instead.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7324792
Asker : mgalke
Subject : how do I view contents of config.sys and autoexec.bat
Private : No
Question : As the subject implies, can you tell me what text editor (or even
through a text editor at all) should I use to view to contents of config.sys and
autoexec.bat? Thanks!!
Answer : Several ways to view or edit it:
In Windows:
Start/Run/Notepad - file/open c:\config.sys
Start/run/msconfig
In DOS:
edit c:\config.sys
type c:\config.sys
more c:\config.sys
autoexec.bat is stored at the same path, so just change config.sys anywhere
above with autoexec.bat to view it instead.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7328982
Asker : Anonymous
Subject : Force program to load in window?
Private : No
Question : How do I force a DOS program that runs in full-screen mode, to run in
a DOS window?
I open the program from MS-DOS prompt that is in window-mode, but when it loads
it changes to full-screen. How can I get around this?
Thanks in advance.
Answer : Once the app goes full-screen you can press ALT-ENTER to go back to
windowed mode. At that point if you're starting the program from it's own
shortcut (make one and do so, if you aren't) you click the top-left icon for
that window and select Properties. Then drop down the Run option and choose
"Normal window" instead of Maximized or full screen. When it asks "apply the
changes to the shortcut that started this program" choose that option so the
changes are saved.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7330748
Asker : mgunthe
Subject : Where can I get a bootable DOS disk?
Private : No
Question : Hi,
I need to boot straight into DOS so that I can run a low level format utility.
It has been so long since
I've done this though, I don't know where I can get a bootable DOS disk? Is it
possible to just modify a
MS windows install disk?
Any help would be much appreciated!
Max
Answer : If you're in Windows 95/98/ME you can quickly create one in
Start/Settings/Control Panel/Add-Remove Programs/Startup disk tab. Once the disk
is made copy your low-level format utility (deleting some of the larger things
on the floppy you don't need to make room) and reboot. Hold the left SHIFT key
during the entire boot and you will skip all boot files and have a perfectly
clean DOS session.
If you don't have access to a 95/98/ME machine to make the disk you can create
one as follows:
OK - Make a boot floppy (on your or another Windows machine) as follows:
Start/Programs/MS-DOS Prompt
(put a blank floppy in the drive)
format a:
c:
cd \
sys a:
copy windows\himem.sys a:\
copy windows\smartdrv.exe a:\
copy windows\command\mscdex.exe a:\
copy windows\command\xcopy*.* a:\
copy windows\command\format.com a:\
copy windows\command\edit.com a:\
copy windows\command\sys.com a:\
Download the following file to A:\
http://members.home.com/iqueue/idecd.sys
Now create a config.sys as follows:
edit a:\config.sys
The config.sys needs the following in it:
device=\himem.sys
device=\idecd.sys /d:cdrom001
Save the config.sys
Now edit A:\AUTOEXEC.BAT and put the following in it:
@echo off
\mscdex.exe /d:cdrom001 /l:f
\smartdrv /n c+ f 4096 4096
Save the file and exit.
Now test the disk and ensure it boots and brings the CD-ROM drive up
successfully as letter F.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7343995
Asker : digsby14
Subject : BAT File programing
Private : No
Question : Hello,
I would like to know if anyone knows where I can get the basics of .BAT file
programing. Things like how to do an if/else, create variables, and how to loop.
The basics of programing.
thanks,
dan
Answer : Here's a good tutorial:
http://home7.inet.tele.dk/batfiles/intro/contents.htm
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 4
----------------------------------------------------------------------
QAId : 7360013
Asker : azern1@...
Subject : invalid partition table
Private : No
Question : Help! I am getting "invalid partition table. Setup cannot continue"
message. Do I need to run fdisk? If so, are there any special parameters I need
to type in or just "fdisk". Will I need to format the disk after that step?
Also, I will need to install Windows 98 after that. What is the best way to
proceed?
Thank you so much!!!
Need More Information : What are you doing that is causing this message? Are you
starting an install of Windows 98? Details... I can't read minds so the more
detail you give me the more likely I can give you good advice.
FUQuestion : I am working on one of several donated computers to be used for an
after-school program. All work but this one - the above message is what appears
upon boot-up. I need to get it up and running is all. I'm not sure in what order
I need to do a format (there is nothing on the disk to lose), fdisk (if
necessary) etc. Thank you
Answer : OK, so we're starting a clean install from scratch...
OK - Make a boot floppy as follows:
Start/Programs/MS-DOS Prompt
(put a blank floppy in the drive)
format a:
c:
cd \
sys a:
copy windows\himem.sys a:\
copy windows\smartdrv.exe a:\
copy windows\command\mscdex.exe a:\
copy windows\command\xcopy*.* a:\
copy windows\command\format.com a:\
copy windows\command\edit.com a:\
copy windows\command\sys.com a:\
Download the following file to A:\
http://members.home.com/iqueue/idecd.sys
Now create a config.sys as follows:
edit a:\config.sys
The config.sys needs the following in it:
device=\himem.sys
device=\idecd.sys /d:cdrom001
Save the config.sys
Now edit A:\AUTOEXEC.BAT and put the following in it:
@echo off
\mscdex.exe /d:cdrom001 /l:f
\smartdrv /n c+ f 4096 4096
Save the file and exit.
Now you will have a bootable disk that will bring up your CD-ROM as drive letter
F: - the best thing to do at this point in your reinstall is NOT to launch the
install, but rather ensure you have XCOPY.EXE and XCOPY32.EXE on the floppy or
in the C:\ directory and do an xcopy of all the files in the Win98 subdirectory
off the CD to your hard disk and perform the installation from *there*. Why? A
couple of reasons - one is the installation goes faster from the hard disk, but
that's a minor reason. The primary reason is that after installation you will no
longer be bothered by that annoying 'please insert your Windows 98 CD' when
upgrading drivers, installing new versions of DirectX, etc, since all the source
files for the OS are on your disk. The XCOPY command looks as follows:
(boot from floppy and format the hard drive
a:
format c:
sys c:
if necessary - be sure you have a backup first of whatever you want to keep!)
xcopy f:\win98\*.* c:\win98kit\*.* /e
Now boot off the hard disk and do:
cd \win98kit
echo y | lock c: /off
setup
--
Paul Doherty, CNA, CNE, MCP+I, MCSE, A.A., B.A.
http://home.attbi.com/~bitbucket911
Home of PC DiskMaster and other Windows utilities
----------------------------------------------------------------------
QAId : 7364709
Asker : mikel1249
Subject : Xcopy
Private : No
Question : This is for Command Prompt in W2000, but it seems to be very similar
to MSDOS.
I have trying to use Xcopy to move A directory and its contents to a partition
on another drive.
My command is:
xcopy L:\My Documents F: E/ V/ K
I get the error message:
Invalid number of parameters
I presume the system can cope with long file names, since it is part of Windows.
What am I doing wrong?
Thanks,
Mike.
Answer : At least part of your problem stems from you using a parameter with a
space in the name. DOS uses a space as a delimiter so it can tell where one
parameter ends and the next begins (and also where the command itself ends and
parameters begin). So where you've typed:
L:\My Documents
it should be:
"L:\My Documents"
so DOS will realize this is one parameter and not two ("L:\My" and "Documents",
separated by the space).
Secondly I see issues with your use of the optional switches - some you left out
the slash ("K") and others you changed the order so that the slash came after
the switch ("E/"). The whole command should look like this in order to do what
you want:
xcopy "L:\My Documents\*.*" F:\Archive\*.* /E /V /K
where "F:\Archive" is the directory on F: where you want the files and
subdirectories you're copying to go.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7368753
Asker : reachbaig
Subject : copying large data on to multiple floppy disk one by one
Private : No
Question : HI
I would like to copy a dir structure which is large having sub directories.
I want to copy on floppy disk as i dont have a zip drive . so what is the
command and switch included to copy that dir and files on to floppy .. i know
the floppy will be 1.44MB size but i would like the system to prompt me for
inserting another floppy disk if the first one is full.
Thanks and regards
Answer : Download the free version of WinZip - it has two features that make it
desirable for this task. One is supports the spanning of mulitpl floppies you
speak of, and secondly it will compress all the data so you use less disks in
the end for your backup.
http://www.winzip.com
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7368765
Asker : leeegglestone
Subject : dos commands
Private : No
Question : If i wanted to boot my pc from dos ,for example if the opearating
system installed wasnt working properly.
How would i do it
using the cd rom disk?? and ensuring the info on the hard drive isnt wiped??
to allow me to install the operating system again
Answer : Boot from a boot floppy instead...
To make a boot floppy (on your or another Windows machine):
Start/Programs/MS-DOS Prompt
(put a blank floppy in the drive)
format a:
c:
cd \
sys a:
copy windows\himem.sys a:\
copy windows\smartdrv.exe a:\
copy windows\command\mscdex.exe a:\
copy windows\command\xcopy*.* a:\
copy windows\command\format.com a:\
copy windows\command\edit.com a:\
copy windows\command\sys.com a:\
Download the following file to A:\
http://members.home.com/iqueue/idecd.sys
Now create a config.sys as follows:
edit a:\config.sys
The config.sys needs the following in it:
device=\himem.sys
device=\idecd.sys /d:cdrom001
Save the config.sys
Now edit A:\AUTOEXEC.BAT and put the following in it:
@echo off
\mscdex.exe /d:cdrom001 /l:f
\smartdrv /n c+ f 4096 4096
Save the file and exit.
Now test the disk and ensure it boots and brings the CD-ROM drive up
successfully as letter F.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
Rating : 4
----------------------------------------------------------------------
QAId : 7390521
Asker : gsale
Subject : Printing DOS screen
Private : No
Question : I'm trying to invert the MSDOS window so that the text is black and
the background is white so that when I screen capture the dos window and paste
it into Word, the printer won't use so much ink. I've tried using the PROMPT
$e[7m command to invert the color scheme but it doesn't seem to work. I tried
changing the config.sys file to add device=c:\windows\command\ansi.sys to the
config.sys file but it doesn't seem to take affect. I'm using MSDOS Windows 98
[Version 4.10.1998]
Answer : Why not just use the clipboard to copy and paste the text and avoid the
printing of the text as a bitmap?
With the test you want in the DOS window click the selection tool in the toolbar
at the top of the DOS window. It looks like a dotted square if I'm remembering
correctly. After clicking that drag from the top-left of the text area to the
bottom-right so that all the text is inside the square you draw. Then click the
copy button next to the selection tool icon to put the text into the Windows
clipboard. Now simply go to Word or Notepad or any other text-handling app and
paste (Edit/Paste) the text into it.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7410080
Asker : mikel1249
Subject : Further Xcopy
Private : No
Question : Paul – you gave the following answer:
pauldoherty gave this response on 2/26/2002:
At least part of your problem stems from you using a parameter with a space in
the name. DOS uses a space as a delimiter so it can tell where one parameter
ends and the next begins (and also where the command itself ends and parameters
begin). So where you've typed:
L:\My Documents
it should be:
"L:\My Documents"
so DOS will realize this is one parameter and not two ("L:\My" and "Documents",
separated by the space).
Secondly I see issues with your use of the optional switches - some you left out
the slash ("K") and others you changed the order so that the slash came after
the switch ("E/"). The whole command should look like this in order to do what
you want:
xcopy "L:\My Documents\*.*" F:\Archive\*.* /E /V /K
where "F:\Archive" is the directory on F: where you want the files and
subdirectories you're copying to go.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Xcopy worked like a charm thanks.
However, when you check properties, the new directory is four times as big and
has about twenty times the number of files. The first level subdirectories seem
the same and the ones I checked are the same size. In case it’s relevant, both
drives are FAT32. It doesn’t matter much that this lot is incorrect, but it
would be good to find out what I did wrong.
Need More Information : First off try deleting what's there (if possible without
losing anything) and doing the copy again before we decide anything is different
or wrong. Do the following in a DOS prompt inside Windows:
f:
cd \
deltree archive
Now do the copy again:
xcopy "L:\My Documents\*.*" F:\Archive\*.* /E /V /K
Now do the following:
cd archive
dir /s /a /-p > c:\copy.txt
and this as well:
L:
cd "\my documents"
dir /s /a /-p > c:\orig.txt
Now compare the contents of those two text files - they should be the same. In
fact you may even be able to quickly compare them with the following command:
fc c:\orig.txt c:\copy.txt
Let me know what you find. If the numbers of files are the same but more SPACE
is being used on one drive than another then that is no cause for alarm.
Different disk partitions can use different cluster sizes. Cluster sizes dictate
the smallest element on a disk - sort of like the old concept of an atom being
the smallest unit of matter. If a file is smaller than the cluster size it must
still take up at minimum one cluster so some space is wasted. For a given file
the larger the cluster the more space will be wasted. This obviously only
applies to files that are smaller than the cluster size of the partition in
question (cluster sizes usually are between 4 and 64K (Kilobytes)). For larger
files what happens is that many clusters are used, and all are filled to
capacity except perhaps the last one if the last amount of data to be stored is
not exactly enough to fill the cluster. So large files waste less space on your
disk since they will fill many clusters completely, leaving at most one
partially full. Contrast this with small files, which must take up at least one
cluster, but many times do not come near filling up even that one cluster (for
example a 100 byte AUTOEXEC.BAT file in an 8K cluster - roughly 7,900 bytes are
wasted), and you can see that small files, while taking up little in actual data
space (the total shown at the bottom of the DIR output) can take up large
amounts of your actual disk space by allocating less-than-full clusters.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
FUQuestion : I wiped out Archive and did it again - still the same problem: too
many files.
This time I checked the first level sub-directories - Of about 20 - 30 most were
ok. Six were nearly right: 1 - 3 files over or under. One, however, was way out
- about 800 extra files and 70 extra directories.
Answer : After you do:
f:
cd \
deltree archive
ensure that the F:\Archive directory is actually gone before running the copy
again. And before doing the copy do this:
xcopy "L:\My Documents\*.*" F:\Archive\*.* /E /V /K
L:
cd "\my documents"
dir /s /a > c:\L.txt
Also do the same on F:\Archive after the copy:
F:
cd \archive
dir /s /a > c:\F.txt
You'll notice at the bottom of both text files a summary like this:
Total Files Listed:
6326 File(s) 654,113,906 bytes
You can see the total number of files in the source directory and the
destination and ensure they are the same.
And do the copy this way:
xcopy "L:\My Documents\*.*" F:\Archive\*.* /E /H /V /K
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
FUQuestion : After doing
f:
cd \
deltree archive
there were a few directories left – not deleted.
Then:
xcopy "L:\My Documents\*.*" F:\Archive\*.* /E /V /K
copied only about 20% of directories
And then,
xcopy "L:\My Documents\*.*" F:\Archive\*.* /E /H /V /K
Also copied only a few directories – it seemed to trip on a long directory name:
Health\Marijuana\New Scientist\New Scientist Planet Science Marijuana Special R
eport addiction, safety, effects on your brain -- find the answers about cannabi
s here Let's be adult about this___files\references.gif
Health\Marijuana\New Scientist\New Scientist Planet Science Marijuana Special R
eport addiction, safety, effects on your brain -- find the answers about cannabi
s here Let's be adult about this___files\title.gif
Health\Marijuana\New Scientist\New Scientist Planet Science Marijuana Special R
eport addiction, safety, effects on your brain -- find the answers about cannabi
s here Let's be adult about this___files\navbarsearch.gif
Health\Marijuana\New Scientist\New Scientist Planet Science Marijuana Special R
eport addiction, safety, effects on your brain -- find the answers about cannabi
s here Let's be adult about this___files\site=NS&nssection=POT&size=120x60.html
Health\Marijuana\New Scientist\New Scientist Planet Science Marijuana Special R
eport addiction, safety, effects on your brain -- find the answers about cannabi
s here Let's be adult about this___files\site=NS&nssection=POT&size=468_60.html
Unable to create directory F:\Archive\Health\Marijuana\New Scientist\New Scienti
st Planet Science Marijuana Special Report addiction, safety, effects on your b
rain -- find the answers about cannabis here Let's be adult about this___files\
site=NS&nssection=POT&size=120x60_files
2572 File(s) copied
Yet, this was all copied successfully previously.
I have been doing this in the MSDOS that comes with Win 98. Previously, I might
have been using the command prompt in W2000.
Is it possible there is corruption in the system?
I’ll be buying Norton Ghost later. It’s not possible that it does this sort of
stuff?
Answer : Ghost doesn't do that - it images whole partitions or disks.
One thing you may want to try is go and get the command-line add-on for WinZip
and use it from within your BAT file to zip up and then unzip the directory tree
in question. It may be able to handle those long directory names for you. The
download is here:
http://www.winzip.com/wzcline.htm
It has documentation with it showing the syntax you'll use to zip and then
extract the directory structures. Just perform a zip from "L:\My Documents\*.*"
to F:\mydocs.zip or somesuch. Then on the next line of the BAT file extract it
to F:\archive which will recreate the structure.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7441117
Asker : harleydaividson
Subject : DOS Batch File
Private : No
Question : Dear experts,
I'm planning to install multiple versions of windows. Is there a batch file that
when booting gives you a menu of the operating systems installed on your PC and
lets you choose which one will you use. If there is, where can I find it and how
will I use it?
Any help would be greatly appreciated.
Thank you very much.
Answer : There is no BAT file to do this. What you need to do is properly plan
your install. One of the things to be aware of is that, without the use of third
party software like System Commander, you cannot install two versions of the
same family of Windows (for example Windows 95 and Windows 98). You can install
two versions of Windows from different families, however, with no additional
software (for example Windows 98 and Windows 2000). To do this simply install
Windows 98 first, followed by Windows 2000. Be sure before beginning that you
have set aside a partition or free space for both OS's. Then install 98 to the
first partition and 2000 to the second.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7501735
Asker : pbolan
Subject : dos
Private : No
Question : I used to have a bat file program for rewriting diskettes.Which
basically read the diskette and stored the info away,then formatted the diskette
and rewrote the info on the diskette.This was done to overcome any magnetic
deterioration during the years'
I can't remember how to answer questions like yes or no or enter on a bat file
.Assuming I made myself clear do you know the hidden commands for that.
Thank you
Paul
Answer : If you mean how can you answer y or n to a query inside a BAT file you
can do it like this:
echo y | program
echo n | program
where 'program' is the command you're running that will be asking for a y or n
answer.
As for generating a carriage return, I've done it this way in the past:
copy con c:\wherever\return
^M
^Z
In the above sequence "^M" and "^Z" mean press CTRL-M, and CTRL-Z, respectively.
Now you have a file that contains a CR and can use it at the command line:
program < c:\wherever\return
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7501808
Asker : kvaruni
Subject : Passing results of a dos command to another command
Private : No
Question : I want to use the find command to extract a part of another command,
but I want the result of this find command to be used as a parameter for another
command.
So what I want is something like this
command1 | find "string" -> and the result of this command needs to be passed to
a second one:
command2 result
Can anyone help?
Answer : What you want is not achievable with straight DOS. You may try using my
utility Recurse to assist you, however. You can store the results from the first
part to a file:
command1 | find "string" > c:\temp.txt
And with the second line of the BAT file call recurse to deal with the resultant
item(s) in the temp.txt file:
recurse c:\2ndcmd.bat c:\temp.txt
and 2ndcmd.bat would contain simply this:
@echo off
command2 %1
If you expect multiple entries from your initial "command1 | find" commands use
the concatenation operator to add all of them to temp.txt:
command1 | find "string" > c:\temp.txt
(some other functions, or perhaps your command1 gets run multiple times within a
'for' loop)
command1 | find "string" >> c:\temp.txt
command1 | find "string" >> c:\temp.txt
command1 | find "string" >> c:\temp.txt
Note the first one is the standard output redirection - doing this will ensure
that only fresh data is in the file as this first usage will empty the file
before putting the result in it.
Recurse and other tools of my design are on my webpage below.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7545589
Asker : davecoll
Subject : DOS Mode
Private : No
Question : I have just set up a new computer system with Windows 98
SE.Everything in Windows seems to work fine, but in DOS mode I have no CD_ROM
drive or ATAPI ZIP Drive. If I go to the DOS prompt under Windows its ok, but if
I boot up in DOS, or restart in DOS mode I have no CD or ZIP drive.My
autoexec.bat and config.sys file in C: are blank.
What did I do wrong?
How do I fix it?
Answer : That is normal. DOS by itself does not support optical or ZIP drives
without you loading specific drivers to get them to work. For the ZIP drive you
will need to visot iomega.com and download their DOS drivers. For the CD-ROM
grab this file:
http://ped.deadartists.com/idecd.sys
Copy it to your C:\WINDOWS directory and then edit the config.sys and
autoexec.bat as below:
config.sys:
device=\windows\idecd.sys /d:cd1
autoexec.bat
\windows\mscdex.exe /d:cd1 /l:f
Now when you boot to DOS (pure DOS that is, by pushing F8 right as the machine
starts to boot (or holding the CTRL key) and choosing "Command Prompt Only") you
will have your CD-ROM drive on letter F:
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 4
----------------------------------------------------------------------
QAId : 7571674
Asker : Anonymous
Subject : Pause in Batch Files
Private : No
Question : Windows 2000/XP Batch File
I am creating a batch file. I'd like to put a pause (for a ? amount of seconds)
between different operations, but not by using the command "pause" which says
"press any key to continue"
In Unix, this is possible by using the "sleep" command. If you put "sleep 2" in
a Unix batch file, it will pause for 2 seconds.
Is there a command in Windows that allows this feature?
Answer : Download sleep for DOS here:
http://ped.deadartists.com/sleep.exe
Rating : 5
End :
----------------------------------------------------------------------
QAId : 7627802
Asker : Anonymous
Subject : Where should the Himem.sys file be?
Private : Yes
Question : Could you tell me where the Himem.sys file should be so that your
computer can work in the Dos mode. I happen to find there is a Himem.sys in my
C:\Windows and another (the same size) in the root drive C:\. And below is the
content of my Config.sys file.
When Win98 starts, it says there is an error in my Config.sys file (Line 8:
DEVICE=C:\windows\command\HIMEM.SYS )
Please help me correct this. I cannot use Scandisk in the Dos mode either.
My gratitude,
[menu]
menuitem=win
menuitem=SETUP_CD, Start Windows 98 Setup from CD-ROM.
menuitem=CD, Start computer with CD-ROM support.
menuitem=NOCD, Start computer without CD-ROM support.
menudefault=SETUP_CD,30
menucolor=7,0
DEVICE=C:\windows\command\HIMEM.SYS
[SETUP_CD]
device=c:\windows\himem.sys
device=himem.sys /testmem:off
device=oakcdrom.sys /D:oemcd001
device=btdosm.sys
device=flashpt.sys
device=btcdrom.sys /D:oemcd001
device=aspi2dos.sys
device=aspi8dos.sys
device=aspi4dos.sys
device=aspi8u2.sys
device=aspicd.sys /D:oemcd001
[CD]
device=c:\windows\himem.sys
device=himem.sys /testmem:off
device=oakcdrom.sys /D:oemcd001
device=btdosm.sys
device=flashpt.sys
device=btcdrom.sys /D:oemcd001
device=aspi2dos.sys
device=aspi8dos.sys
device=aspi4dos.sys
device=aspi8u2.sys
device=aspicd.sys /D:oemcd001
[win]
[NOCD]
device=himem.sys /testmem:off
[COMMON]
device=c:\windows\himem.sys
files=60
buffers=20
dos=high,umb
stacks=9,256
rem - By Windows Setup - lastdrive=z
Answer : Just take line 8 out of your CONFIG.SYS file. First off it references
himem.sys from a path where it doesn't exist, and secondly, it's redundant since
you are already loading himem.sys (correctly) from each of the menu sections
beneath it. No mention of any drivers including himem.sys should be in the
"menu" section.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7635429
Asker : Anonymous
Subject : Where should the Himem.sys file be?
Private : No
Question : Could you tell me where the Himem.sys file should be so that your
computer can work in the Dos mode. I happen to find there is a Himem.sys in my
C:\Windows and another (the same size) in the root drive C:\. And below is the
content of my Config.sys file.
When Win98 starts, it says there is an error in my Config.sys file (Line 8:
DEVICE=C:\windows\command\HIMEM.SYS )
Please help me correct this.
My gratitude,
[menu]
menuitem=win
menuitem=SETUP_CD, Start Windows 98 Setup from CD-ROM.
menuitem=CD, Start computer with CD-ROM support.
menuitem=NOCD, Start computer without CD-ROM support.
menudefault=SETUP_CD,30
menucolor=7,0
DEVICE=C:\windows\command\HIMEM.SYS
[SETUP_CD]
device=c:\windows\himem.sys
device=himem.sys /testmem:off
device=oakcdrom.sys /D:oemcd001
device=btdosm.sys
device=flashpt.sys
device=btcdrom.sys /D:oemcd001
device=aspi2dos.sys
device=aspi8dos.sys
device=aspi4dos.sys
device=aspi8u2.sys
device=aspicd.sys /D:oemcd001
[CD]
device=c:\windows\himem.sys
device=himem.sys /testmem:off
device=oakcdrom.sys /D:oemcd001
device=btdosm.sys
device=flashpt.sys
device=btcdrom.sys /D:oemcd001
device=aspi2dos.sys
device=aspi8dos.sys
device=aspi4dos.sys
device=aspi8u2.sys
device=aspicd.sys /D:oemcd001
[win]
[NOCD]
device=himem.sys /testmem:off
[COMMON]
device=c:\windows\himem.sys
files=60
buffers=20
dos=high,umb
stacks=9,256
rem - By Windows Setup - lastdrive=z
Answer : Remove line #8
DEVICE=C:\windows\command\HIMEM.SYS
You are already correctly loading himem.sys from the Windows directory in each
section. The "menu" section should never have any drivers listed.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7643125
Asker : Anonymous
Subject : Why the CD-Rom doesnt' work in Dos mode?
Private : No
Question : I have made a startup disk, but it is strange that when I use it to
boot the computer, it cannot detect there is a CD-Rom drive.
Later, I try to boot from my hard drive and found that, if I enter the Command
Prompt mode (Dos mode), I also cannot detect the CD-Rom drive, although the
Cd-Rom drive works well in Windows mode.
Can you help explain this situation?
Answer : CD-ROMs require a driver to accessed. Windows has those drivers. DOS
doesn't.
Download this file:
http://ped.deadartists.com/idecd.sys
Save it to the floppy or to C:\
Also copy the following files to your floppy:
mscdex.exe
himem.sys
smartdrv.exe
Then edit the following files on your floppy or the root of C: and add the lines
shown:
CONFIG.SYS:
device=\himem.sys
device=\idecd.sys /d:cd1
AUTOEXEC.BAT
\mscdex.exe /d:cd1 /l:f
\smartdrv.exe /n c+ f 8192 8192
Rating : 5
----------------------------------------------------------------------
QAId : 7651449
Asker : asaini64
Subject : Batch file
Private : No
Question : Hi there,
I am in process of creating of a batch file. I want to delete a file created on
a previous day eg I echo %date%, %time% >> %date%.txt.
when this file runs next day I want the file created on previous day get
deleated how should i go about it.
Thanks
Adarsh
Answer : Processing filenames based on their dates is not a trivial task in DOS.
I suggest you look info my utility DateSet as you may be able to use it for this
task with a little ingenuity.
http://home.attbi.com/~bitbucket911
FUQuestion : Hi Paul Thanks for your help but when I run it on a windows 2000
system i am getting an error.
3052:uninitialized variable or undefined function
ampm=param4
Winbatch 32 2000c
WIL version:3.0cbv
Thanks
Adarsh
Rating : 4
Need More Information : If you woould, give me some details on what you did
installing it and what BAT file you used to invoke it.
FUQuestion : Paul,
I unzipped dataset to a directory c:\adarsh\dateset
I first tried to run the dateset from the folder itself then tried from the
command prompt both times I got the same message. It did not create the batch
file in the name of mydate.bat. But i manually created mydate.bat with the
contents you mentioned in the text file that works fine only problem is I cannot
create a batch file daily.
Thanks
Answer : DateSet runs fine for me under Windows XP. Try getting the DateSet
archive from my other web site - http://ped/deadartists.com
Then create a BAT file to invoke it and test:
@echo off
c:\adarsh\dateset\dateset.exe
call c:\mydate.bat
echo %YEAR%
echo %SECS%
echo %AMPM%
echo %HOURS%
Let me know what you get from that.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7664432
Asker : Anonymous
Subject : DOS delete file depends upon date
Private : No
Question : I have to delete some file in DOS environment depends upon date of
last modification. how to do that?
Answer : Use my utility ProcessByDate I wrote to overcome this DOS limitation.
http://ped.deadartists.com/ProcessByDate.zip
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7668934
Asker : creanius
Subject : boot from DOS and then go to Windows
Private : No
Question : I am unable to boot my computer from the hard disk (with win98 Second
edition) and when i use a floppy to boot it, it opens in DOS. How can i then go
to windows mode from DOS? and what can i do to make my computer boot from the
hard disk?
Answer : Some detail about what happens when you try to boot from DOS would be
very helpful if you want a diagnosis. You need to be booting from the hard drive
to run Windows. One thing you may try (shot in the dark until you reply with
details of what your hard drive is doing) is booting from the floppy and then
issuing the command from A:\ (type it exactly as you see it):
c:\windows\sys.com c:
c:\windows\fdisk.exe /mbr
Now take the floppy out and try to reboot.
NOTE - Only try this procedure if the DOS floppy you're using was made from the
same machine (that is, the same or if older a very recent version of
Windows/DOS).
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
FUQuestion : I do not have a boot disk and can make one from another machine.
now what do i do?
Need More Information : You *can* or *cannot* make one from another machine?
You're going to have to warm up those fingers and type some detail if I'm going
to help you. What does the hard drive do when you try to boot from it?
FUQuestion : whenever i start the computer it asks to insert a boot disk and
then press enter. I CAN make a boot disk from another machine but it has Windows
Me. The computer does not boot from hard disk and asks for a boot disk (floppy)
and does not boot from even a CD.
Need More Information : Is the hard drive even accessible after booting from a
floppy? Try this:
dir c:\
after booting from floppy. Do you see the files and dirs on C: or just an error
message?
Second check your BIOS (press DEL usually during a cold boot - during RAM test)
and be sure that:
a) The hard drive is detected on the primary channel as Master.
b) That the parameters for the drive are correct (or set to "Auto").
c) That in your boot order the hard drive appears after the floppy and CD-ROM
drives. As a testing step you may want to make the hard disk the first device
just to be sure nothing else gets tried first.
If all of those are OK and you saw files in the first test above I would get a
DOS boot disk from a Windows 98 machine (or from http://www.bootdisk.com) and
perform the steps I mentioned in the first message (sys and fdisk /mbr).
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7681240
Asker : kellie_fitton
Subject : Looking for deltree.exe and move.exe files...
Private : No
Question : Hello,
in windows XP home edition we can not find the
files "deltree.exe" and "move.exe" which we used
to have in windows 98se. Is there other files in
windows XP that do the same functions?
thank you, kellie.
Answer : Windows XP has the "move" command (may have moved to an internal
command as I see no EXE/COM for it). Deltree was not included in XP for whatever
reason MS may have. You are stuck with "rd" (remove directory) which has the
unpleasant limitation (and original reason for the creation of deltree) that is
will not remove any directory that isn't empty. Which means you have to recurse
your way through it deleting all the files and removing all the dirs before you
could use it to remove the one branch you really wanted to be rid of. So the GUI
is the best choice for removing dirs in XP.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7711213
Asker : jsimontex
Subject : MSDOS
Private : No
Question : How do I reboot my computer to msdos?
Answer : Depending on the Windows OS you're using (which may dictate whether you
even HAVE DOS or not) you can get to it by holding the left CTRL key down during
a reboot until a menu appears. Choose "Command Prompt Only" if that option is
available and you'll be in pure DOS.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7713544
Asker : abofahad9
Subject : I need a command
Private : No
Question : I need a command that let me go directly to specific key in windows
registry
for example I would like a command to go to HKEY_USERS\.DEFAULT\Software
Or to delete a key without opening registry.
Hope I find answer
thanks
Answer : Taken from Usenet:
REG operation <Parameter List>
operation [ QUERY | ADD | UPDATE | DELETE | COPY |
SAVE | BACKUP | RESTORE | LOAD | UNLOAD ]
For help on a specific operation type:
REG operation /?
Examples:
REG QUERY /?
REG ADD /?
REG UPDATE /?
REG DELETE /?
REG COPY /?
REG SAVE /?
REG BACKUP /?
REG RESTORE /?
REG LOAD /?
REG UNLOAD /?
REG QUERY RegistyPath [\\Machine] [/S]
RegistryPath [ROOTKEY\]Key[\ValueName]
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
Optional. When omitted HKLM is assumed.
Key The full name of a registry key under the selected
ROOTKEY.
ValueName The value, under the selected Key, to query.
Optional. When omitted all keys and values under the
Key
are listed.
Machine Name of remote machine - omitting defaults to current
machine.
Only HKLM and HKU are available on remote machines.
/S, /s Queries all subkeys.
Examples:
REG QUERY HKLM\Software\Microsoft\ResKit\Setup\InstallDir
Displays the value of the InstallDir registry entry.
REG QUERY HKLM\Software\Microsoft\ResKit\Setup /S
Displays all keys and values under the Setup sub-key.
Rating : 5
----------------------------------------------------------------------
QAId : 7748639
Asker : saliz
Subject : restore
Private : No
Question : i have no restore CD
i was told i was able to restore the system using a startup disk
i have reformated the PC
and i need to comands in msdos to reinstall the original operating system on the
pc.
(windows 95)
Answer : OK - Make a boot floppy as follows:
Start/Programs/MS-DOS Prompt
(put a blank floppy in the drive)
format a:
c:
cd \
sys a:
copy windows\himem.sys a:\
copy windows\smartdrv.exe a:\
copy windows\command\mscdex.exe a:\
copy windows\command\xcopy*.* a:\
copy windows\command\format.com a:\
copy windows\command\edit.com a:\
copy windows\command\sys.com a:\
Download the following file to A:\
http://members.home.com/iqueue/idecd.sys
Now create a config.sys as follows:
edit a:\config.sys
The config.sys needs the following in it:
device=\himem.sys
device=\idecd.sys /d:cdrom001
Save the config.sys
Now edit A:\AUTOEXEC.BAT and put the following in it:
@echo off
\mscdex.exe /d:cdrom001 /l:f
\smartdrv /n c+ f 4096 4096
Save the file and exit.
Now you will have a bootable disk that will bring up your CD-ROM as drive letter
F: - the best thing to do at this point in your reinstall is NOT to launch the
install, but rather ensure you have XCOPY.EXE and XCOPY32.EXE on the floppy or
in the C:\ directory and do an xcopy of all the files in the Win95 subdirectory
off the CD to your hard disk and perform the installation from *there*. Why? A
couple of reasons - one is the installation goes faster from the hard disk, but
that's a minor reason. The primary reason is that after installation you will no
longer be bothered by that annoying 'please insert your Windows 98 CD' when
upgrading drivers, installing new versions of DirectX, etc, since all the source
files for the OS are on your disk. The XCOPY command looks as follows:
(boot from floppy and format the hard drive
a:
format c:
sys c:
if necessary - be sure you have a backup first of whatever you want to keep!)
xcopy f:\win95\*.* c:\win95kit\*.* /e
Now boot off the hard disk and do:
cd \win95kit
echo y | lock c: /off
setup
--
Paul Doherty
http://home.attbi.com/~bitbucket911
Home of PC DiskMaster and other Windows utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7755337
Asker : saliz
Subject : restore
Private : No
Question : i have no restore CD
i was told i was able to restore the system using a startup disk
i have reformated the PC
and i need to comands in msdos to reinstall the original operating system on the
pc.
(windows 98)
Answer : You don't have a restore CD.
I'll assume you have the Windows 98 CD - if not then you're stuck.
OK - Make a boot floppy as follows:
Start/Programs/MS-DOS Prompt
(put a blank floppy in the drive)
format a:
c:
cd \
sys a:
copy windows\himem.sys a:\
copy windows\smartdrv.exe a:\
copy windows\command\mscdex.exe a:\
copy windows\command\xcopy*.* a:\
copy windows\command\format.com a:\
copy windows\command\edit.com a:\
copy windows\command\sys.com a:\
Download the following file to A:\
http://members.home.com/iqueue/idecd.sys
Now create a config.sys as follows:
edit a:\config.sys
The config.sys needs the following in it:
device=\himem.sys
device=\idecd.sys /d:cdrom001
Save the config.sys
Now edit A:\AUTOEXEC.BAT and put the following in it:
@echo off
\mscdex.exe /d:cdrom001 /l:f
\smartdrv /n c+ f 4096 4096
Save the file and exit.
Now you will have a bootable disk that will bring up your CD-ROM as drive letter
F: - the best thing to do at this point in your reinstall is NOT to launch the
install, but rather ensure you have XCOPY.EXE and XCOPY32.EXE on the floppy or
in the C:\ directory and do an xcopy of all the files in the Win98 subdirectory
off the CD to your hard disk and perform the installation from *there*. Why? A
couple of reasons - one is the installation goes faster from the hard disk, but
that's a minor reason. The primary reason is that after installation you will no
longer be bothered by that annoying 'please insert your Windows 98 CD' when
upgrading drivers, installing new versions of DirectX, etc, since all the source
files for the OS are on your disk. The XCOPY command looks as follows:
(boot from floppy and format the hard drive
a:
format c:
sys c:
if necessary - be sure you have a backup first of whatever you want to keep!)
xcopy f:\win98\*.* c:\win98kit\*.* /e
Now boot off the hard disk and do:
cd \win98kit
echo y | lock c: /off
setup
--
Paul Doherty, CNA, CNE, MCP+I, MCSE, CCSA, CCSE, A.A.Sc., B.A.
http://home.attbi.com/~bitbucket911
Home of PC DiskMaster and other Windows utilities
Rating : 5
----------------------------------------------------------------------
QAId : 7762696
Asker : mrwires
Subject : computer starts in dos
Private : No
Question : My wife has an IBM think pad, and when we start it, it starts up in
dos mode, and I have NO idea how to get it to start in windows??? It does or did
have windows 98. Can you help direct us "PLEASE" thank youin advance > Jim
Answer : Try pressing and holding the left CTRL key (right may as well) during a
reboot until a menu appears. Choose "Normal" as the boot choice and see if you
get into Windows that way. If you do then there is probably something set wrong
in your C:\MSDOS.SYS file. If not then try the CTRL trick again except this time
choose the LOGGED boot, then reply to this message with the contents of the file
C:\BOOTLOG.TXT after it fails.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
----------------------------------------------------------------------
QAId : 7763485
Asker : Anonymous
Subject : Dos
Private : No
Question : Hi Guys,
What the best way to learn DOS? Do you think one can learn it by himself,
through books and free online information, and end up being really good.
Thank you.
Answer : Sure you can learn DOS on your own. I'd suggest you pick up a good DOS
reference book (and a few sites like easydos.com) and then start experimenting.
A good way to learn is to try to write BAT files to automate tasks - these will
teach you to think in terms of the abilities/limitations of DOS.
--
Paul Doherty
http://home.attbi.com/~bitbucket911
DOS/Windows Utilities
Rating : 5
FUQuestion : Thank yo