Microsoft DOS





Microsoft Disk Operating System (MS-DOS) was an operating system for x86-based personal computers, and traces of it are still found in the Windows operating system. DOS is still used in some embedded systems and for certain legacy 16-bit networks.

Share tech news, updates, or what's on your mind.

Sign up to Post

We need to create a series of files with over 1gb size for a project we  have.  We use fsutil and it works; the problem is that it affect the "free space" when querying the disk size.  Is there a waye to do this?
Upgrade your Question Security!
LVL 12
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

I recently updated a sync computer batch file from xcopy to robocopy.  This resolved some problems but I discovered that robocopy does not copy open files as xcopy did. Does anybody know of a copy routine that can run from a batch file that copies open files. The biggest problem is MS Word keeps files open in the background even after it is closed. It would be great if it has a copy version option (copy newer files to a new version number instead of overwriting the older file) and multi-thread capability. Free or low cost would also be good.

Hi Experts,
pls help me out on this. bit tricky one :)

1. Have a file similar to ".ini" format header and its sections. e.g. schema.ddl
2. Another file with list of keywords on each line. e.g table_list.txt
3. Need to read each line from table_list.txt and search it in schema.ddl and remove the entire table section and its associated index section as well.

Have attached both the files for your quick reference. pls unzip file.

"S_PARTY" is the first keyword from the table_list.txt
table section can be found in schema.ddl between line # 317941 and 317960
associated section can be found between 317962 and 318029

basically for each keyword (table name) we need to repeat the process and remove relative entries using windows batch or powershell or vbscript reason,  this will be executed on a windows machine. if any util that doesnt require installation and would easy this. we can use that util as well.

pls help and thx in advance.
I currently have three folders on my "H" drive
  ** H:\a\.........
  ** H:\b\.........
  ** H:\c\.........

I then do robocopy G:\ H:\ /s /e /copyall /mir /v /tee /r:0 /log:robocopyNOTES.txt and all of the above folders get deleted, even when I do NOT have these folders on the G drive

How can I copy the G drive folders to the H drive, keeping existing H drive folders as-is if they do not have the same name as G drive folders ?
Hi Experts,
I would like to have a script/function that opens the following site
fills in the account, username and password.
See attached.
Should either be done thru Access VBA or via script.
Thanks in advance.
I have the following batch file.

@echo off

set hour=%time:~0,2%
if "%hour:~0,1%" == " " set hour=0%hour:~1,1%
echo hour=%hour%
set min=%time:~3,2%
if "%min:~0,1%" == " " set min=0%min:~1,1%
echo min=%min%
set secs=%time:~6,2%
if "%secs:~0,1%" == " " set secs=0%secs:~1,1%
echo secs=%secs%

set year=%date:~-4%
echo year=%year%
set month=%date:~4,-8%
if "%month:~0,1%" == " " set month=0%month:~1,1%
echo month=%month%
set day=%date:~7,-5%
if "%day:~0,1%" == " " set day=0%day:~1,1%
echo day=%day%

set datef=%hour%-%day%-%month%-%year%
set dayf=%day%-%month%-%year%

echo datetimef=%datef%
echo %dayf%


set findtext=" DS-"
set findfile="Z:\OP\exa\02-04-18 - Copy.P02"

findstr %findtext% %findfile%

for /f "delims=" %%a in ('findstr %findtext% %findfile%') do echo %%a >> "Z:\OP\test-%month%-%year%.txt


Open in new window

I however need to search for multiple criteria i need to find all instances of " DS-" and " DSA-" how do i search for both?
Hello, Everyone, I found two very similar one-liners as part of the solution to WMI issues in SCCM client installation:

1.) from
dir /b *.mof *.mfl | findstr /v /i uninstall > moflist.txt & for /F %s in (moflist.txt) do mofcomp %s

2.) from
dir /b *.mof *.mfl | findstr /v /i uninstall > moflist.txt & for /F %%s in (moflist.txt) do mofcomp %%s

What's the difference between the two? I used the line from link #2 (%%s), but I got the error "%%s was unexpected at this time."   I understand from other posts that using "%%s" in batch files will not yield errors.  When I used the line from link #1 (%s), the command ran.

If both lines get executed successfully, whether via CMD or BAT files, would they have the same end result?

Thank you very much.
I want the name of last modified file from the folder download. I tried with the example given but not quite getting the correct result.
 FOR /F "DELIMS=" %%F IN ('DIR /B /A-D /OD /TW C:\Users\Username\Downloads-??.xlxs') DO (SET FILE=%%F)
 ECHO Most recently modified file is:
 ECHO %FILE% > C:\Users\Username\Desktop\Results.txt

The output I am getting in Results.txt is %FILE% .
Need a batch file script that will copy a file from a network drive and copy it to the individual's desktop.
So here's the data I am looking at..I have a single folder files named this way:
file one (1).ext
file one (2).ext
file one (3).ext
file two 1.ext
file two 2.ext
file two 3.ext
file three a.ext
file three b.ext
file three c.ext ... etc etc

There are about 250,000 of these files in a single folder. I am trying to create a batch file where it will read the name of the file and create a folder based off of the text thats the same and stops when it reaches where the file is different and moves on to the next folder. Then copies the files into the created folder.

For example in the set above, I would end up with three folders: file one, file two and file the each with the 3 corresponding files moved to the correct folder. I came up with as much below but I cant figure out a way to get it to stop reading the file name when it reaches the "(" or the number or the different letter or whatever may be different in the file name. What I end up with is a folder for each file (full file name) and the corresponding file in that folder.

Heres my code:

@echo off
setlocal enabledelayedexpansion
for %%A in (*.ext) do (
   echo file found  %%A
   for /f "delims=" %%B in ("%%A") do set fname=%%~nB
   for /f "delims=" %%C in ("%%A") do set fextn=%%~xC
   for /f "tokens=1* delims=_" %%D in ("!fname!") do set folname=%%D
   echo folder name !folname!
   if not exist "!folname!" (
      echo Folder !folname! does not exist, creating
      md "!folname!"
   ) else (
Free Tool: Subnet Calculator
LVL 12
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.


what I would like is a batch file that will get the folder structure of the drive into a menu structure so that you can select the folder you want to go into, and once you select a folder from the menu, the subfolders of that folder would then be listed in a menu as well, and so on and so forth as deep into the folder structure as you want to drill down to. And in each menu would have a "backup current folder level" and a "list all contents of current folder" and if possible include a "go to previous folder" option.

 Basically I would like to run the batch file and be given a menu of the folders only of the c drive, then be given an option to either backup the current folder, list the files of the current folder in case I wanna to only backup one file from that folder, or select a subfolder and then be given the same options with the addition of the go to previous folder option for subfolders.

 I've tried and tried to write something like this but I'm not a strong batch script writer and just can't get anywhere with it.

 Thank you very much in advance for your help,
i have a folder called FLORIDA and in that folder i have all the user home folders.

within the home folders are .pst files.

how can i copy all the .pst files and keeping the same folder structure?

Hello Experts,
How does ping multipal server IP from a batch file, i need output of ping reply, route info (source interface)  & color in background (if TTL is up output should be in Green otherwise Red).

C:\Users\MainLogin>ping -r 1

Pinging with 32 bytes of data:
Reply from bytes=32 time=31ms TTL=254
Reply from bytes=32 time=31ms TTL=254
Reply from bytes=32 time=37ms TTL=254
Reply from bytes=32 time=32ms TTL=254
With robocopy, is it possible to move any files from the destination to another folder whenever the source file has been removed ?

1. Any files / folders in source will be synchronously exactly with that in destination.
2. Files / folders that are removed from the source will be moved to another folder

I am using this type of batch file command

SET date=%date:~10,4%-%date:~4,2%-%date:~7,2%

echo f | xcopy /f /y "C:\path\filename.txt" "D:\archive\filename%date%_%SAVESTAMP%.txt"

And it is creating the same file in my archive from 2-3 times. I've checked the original directory and there is only the one filename.txt file.

They all have the same date modified and size:

But the SAVESTAMP varies:

We have a very very old labeling program that the electrical department would like to keep using (The printer works and they still have tons of labels in supply) but the program is dos 32bit and the company is no longer in business. Their computer is windows 10 64 bit. I cannot run a 32 bit dos program in windows 64 bit command prompt (at least haven't been able to) so I installed virtual box and installed Doss 6.22. The program works fine but i cannot get it to access lpt1. does anyone know the steps involved (in windows 10 and in the vbox dos) to allow the doss 6.22 to print to lpt1?
HI Experts

Could you advise what is the best way to source two property files inside windows batch file and use those property value in the batch script.

1. I have around 20 property/value in a and files. Assume file1 and file2 has 10 each...coming from two different source (Hope I can concat/append into one single file)

Open in new window

2. Have few batch files, where I would like to source above & (or merged single file) files inside these batch files and use those property value where ever required.
3. I'm used to to Linux way of source <>. But looks like this is not possible in Window Batch? :)
4. In case was populated with additional property/value dynamically. Instead of can have 15 in the future.

Could you help, what is the best way to achieve this please?
Hello all,

Using Borland C++ 4.52 on a Windows Virtual PC in XP Mode.

I am writing what I thought to be a pretty simple DOS program.  It is basically opening files, filling up structures, printing structure information to a file and that's it.  The files are binary and are less than 32 Kbytes, most are 1K or less.   I am 75% of the way done, it has been running fine up to now.  I just added some code to finish it off, and now I am getting this error at runtime:

"The NTDVM CPU has encountered an illegal instruction.
CS:00cc IP:0106 OP:ff ff 00 00 00 Choose 'Close' to terminate the application."

The thing is, the code I added is just a repeat of the same code that was at the beginning but to different structures.  Seems to have something to do with the code size?  I don't know.  I am not that familiar with memory management.  However, when I removed the stuff I had added, it works again.  

I am attaching both the main code and the extra code I am trying to add.

I would appreciate any guidance.
Hi Experts,
We have multipal windows system in network, in BOD process we need to copy some files in every systems manually, its a time taking process for me. Please suggest any bat (automatic) process to short out this trouble. Every systems having user name & password.
The 14th Annual Expert Award Winners
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

while repairing pc's i often boot from the windows 10 install USB stick into command prompt
questions :
1- what commands are available here?
2-can i change the keyboard layout to AZERTY ? if so - how?
Hello Experts,
how does make a bat file for continuous Ping multipal IP with background Colour changes ?
for example:-
start ping -t -l 0
start ping -t -l 0
start ping -t -l 0
start ping -t -l 0
start ping -t -l 0
I have this old batch file that I used to upgrade a software and since it is time for another one I have tried creating a GPO and assigned it under User Configuration>Windows Settings>Logon.

But when testing with a user logging on the batch file wont run but when manually clicking the file it runs perfectly fine!

Here is the code:  xcopy "Source" "Destination" /S /C /I /H /R /Y

Users have a full time mapped drive from where the source file is copied to the local drive C:\Folder

Note that robocopy is the same and doesn't run automatically.

I have Dos application run on the latest Dosbox SVN Daum and printer Epson LQ350 directly conected to LPT1. When i print document from dosbox, printer prints page without last 5 lines. When i exit from dosbox to windows, printer finish printing last 5 lines. Did anyone know, what i must setup, when i want print whole page without exiting dosbox?


iam looking for a solution to count the files in folders & subfolders , calling for a path from the Main DIR.

The output will be Main folder name
(1) Primary folder  (Only name mostly)    (2) All the list of subfolders with count of files    (3) Only file extension.

This will include any empty folders

Also wish to know if any alternate tools which can copy large files in lesser time. ( From Dir to Dir). I have tried xcopy on Dos prompt even though it takes lot of time.
Hi Experts,

I have some tasks that currently users must do it manually in daily bases, however since this is prone to errors, the manager would like it should get automated done via code.

1- Look for specific file in default download folder that name starts with Tables_TodaysDate_LatestNumber.Zip (See attached).
2- Extract it to specific folder (C:\Application)
3- Delete old File C:\Application\Tables.MDB
4- Rename extracted file (something like Tables_2017-Oct-30_2230.mdb) to Tables.MDB

Would prefer it done either by calling some DOS commands from VBA or just using native VB functions if possible.

Thanks in advance.

Microsoft DOS





Microsoft Disk Operating System (MS-DOS) was an operating system for x86-based personal computers, and traces of it are still found in the Windows operating system. DOS is still used in some embedded systems and for certain legacy 16-bit networks.

Top Experts In
Microsoft DOS