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

i have a subfolder in the users directory. as youcan see, the batch file deletes it. the folder name is OSERV. how can i keep the script but keep OSERV untouched. i cannot move this folder from the USERS directory

Del "E:\Scanning\Users\*.*" /F /Q /S

On Demand Webinar: Networking for the Cloud Era
On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

I need to install a usb boot disk to run a bat file to install winodows updates and Surface Tablet firmware updates
I got this script now running

@echo off

set /p host=host Address:
set logfile=Log_%host%.log

echo Target Host = %host% >%logfile%
for /f "tokens=*" %%A in ('ping %host% -n 1 ') do (echo %%A>>%logfile% && GOTO Ping)
for /f "tokens=* skip=2" %%A in ('ping %host% -n 1 ') do (
    echo %date% %time:~0,2%:%time:~3,2%:%time:~6,2% %%A>>%logfile%
    echo %date% %time:~0,2%:%time:~3,2%:%time:~6,2% %%A
    timeout 1 >NUL
    GOTO Ping)

But i want it so that all the Pings that are <1ms are not recorded.
Is this possible?
I have main Dir  , It contains many sub folders. Need a method to first find the file names which have a space in the beginning of the file and  than remove the space. It should not effect the original file name which contains space in between. (DOS CMD)

folder: task
sub folder : A

I am looking for best solution to subtract a date from a timestamp in my batch file. I have read calling a vbscript to make the calculation is a better option. Any help would be appreciated.

below is part of my script.

rem Setting the Start Date & Time that the batch was launched
set yyyy=%date:~10,4%
set mm=%date:~4,2%
set dd=%date:~7,2%
set hh=%time:~0,2%
set mn=%time:~3,2%
set ss=%time:~6,2%

set yyyy=%date:~10,4%
set mm=%date:~4,2%
set dd=%date:~7,2%
for /f "tokens=1-2 delims=: " %%a in ('time /t') do (set hh=%%a& set mn=%%b)
set ss=%time:~6,2%
set dstamp="%yyyy%"-"%mm%"-"%dd%"_"%hh%%mn%%ss%"
set dstamp2="%yyyy%"."%mm%"."%dd%"
set dstamp3 = dstamp2 - 6 days                  REM<---------------------------------------------------------this is the parameter i need changed

ren  "TRD_Cost.PSV"  "TRD_Cost_%dstamp3%_%dstamp2%.PSV"     REM<----------------------------------------------------renamed here
rem zip -j %exepath%\..\HostTran\Export\Dunnhumby\  %exepath%\..\HostTran\Export\Dunnhumby\TRD_Cost*.PSV >> %log%
rem move %exepath%\..\HostTran\Export\Dunnhumby\   %exepath%\..\HostTran\Export\Dunnhumby\backup\ >> %log%
rem del %exepath%\..\HostTran\Export\Dunnhumby\TRD_Cost*.PSV >> %log%

REM so this is what i want to rename the file: TRD_Cost_dstamp3 _dstamp2.psv where dstamp3 = 

Open in new window

how to find row count of each file of the file type .ref across multiple folders in command prompt and send the output to output.txt file
is there a way on a windows 7 machine to get the connection speed via the command prompt? I'm wanting to check the speed of several computers remotely
I'm looking for the results that look something like this:
network speedthanks!
I have a user who puts the date he wants me to change the to reflect the update in the file name.

Example:  BMS Update 7.21.2017.xlsx

Is there a way to capture this Date in the file name so I can use it in my batch routine?  Maybe like store it in a set variable so I can use it in my batch file.       Set FileDate=FileDate

I cant use file modify date because the modify date and the date in the file name are different.

We are trying to take a regular path and convert it to "short name".  For example:

The normal path:    

C:\Program Files\AVAST Software\avast\

Convert  it to:


We understand fir /x returns the short name of a folder or file, but  we are  trying  to convert specific path.

How can we go about this?
(we use Windows 10)
I have a bunch of files on a windows 10 pc (all in the same folder), they are mostly pdf files, some have extension .pdf others have .PDF.

I recognize that Windows is not case sensitive to file names, but linux / unix / apache is. I want to rename all pfd's to .PDF.

Is there a way using file explore or do I have to revert to command prompt, ren *.pdf *.PDF. Or will that even work?

Free Tool: Subnet Calculator
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.

We need to create a bat file for our Delphi program (Windows environment) in order to help our personnel for avoiding manual operations and possible deleting some crucial files.
I  am trying  to explain you  it simply

We have a shared folder located on Z (map network drive) with name X , so
elegktes.pngThe folder contains a subfolder with name active
•      Every person who is assigned a task (e.g a car plate) is put into active folder.
•      Every person who is free (able to be assigned a job) is outside active folder

For example, We have for the active folder the following
We only use Greek characters for the name of the files.
If a car with plate KNK1234 is assigned to ABC person then the file is
ABC_ΚΝΚ1234.ini, where ABC is the full name of the employee

What we want is
a pilot menu so every time somebody clicks the bat file open a window which says
Which person you want to release? (I will translate all the text into Greek language)
It will display the name of the employees (We can modify it , so the program will read only the names which are inside the active directory)
I will provide the name of the employees (about 6-7 persons)
Do you want to release name of employee Yes or No
Release process (Every time the work on a car is completed, the worker is automatically released from the program.)
There are, however, sometimes for some reasons (repeating a process, etc.), which should be released through a process.

The full name of the person…
Hello All, I have this .bat for change expiration date of users in a .csv file, but I decide which date I want to put.

Now, How can I change that the date will to NEVER?

[b]@echo off

:: *** csv-File with the name, first name, and user name:
set UserFile=\\Srv_\publico\DATOS\Procedimiento\Procedimientos\prorrogarUsuario\prorroga.csv

:: *** Distinguished Name of the container to add the new user to:
set UsersDN=OU=Usuarios,OU=UsuariosCM,OU=CM,DC=D,DC=domain,DC=com

for /f "tokens=1-4 delims=," %%a in ('type "%UserFile%"') do (
  set Userp=%%a
  set Date=%%b
  call :process
goto :leave

set USER=%Userp%

echo Prorrogando usuario
echo Username: %USER% date: %Date%

:: ***echo Hit ^<ctrl-c^> to stop, any other key to create the user.
:: ***pause >NUL

:: *** Test mode: Remove the "ECHO" in front of the following line to run the script for real:
net user %USER% /expires:%Date% /DOMAIN


Open in new window

Can u help me?
what is the command to copy and entire drive with permissions to another server?
How can I run a batch file from within a Word macro?
Hello Experts,

How can I add a batch file to the contextual menu (the one I get when I right click on top of a folder in windows explorer)...

So I can click on my .bat file name in the list and it will get the name of the folder i am pointing at ...  as a parameter and proceed with the instuctions.. ?
Most of my work involves video editing.
The folders (Dir) where I keep originals, copies, pre/post-edit files and so forth are all set with the following "sort" attributes (columns):
Name - Length - Size - Frame Width - Frame Height - Data Rate

For each new folder I create or Copy/Move I have to redo all these attributes again, specially when I copy a folder since it always seems to default back to:
Name- Date Modified - Type - Size or similar values.

You can imagine the amount of time & effort required to do this for all new or copied folders..
I've tried every conceivable syntax with Robocopy and cant get it to work for these reasons:
1. When I open CMD it defaults to the current User, which does have Admin rights, but I can't get Robocopy to work with the "COPYALL" or any other syntax other than "\e" and that only gives me a copied Dir/sub-Dir again with default values..
2. When I open CMD and "Run as Admin" it goes to C:\ .. which is fine, except the DIR Im trying to copy shows as "Cannot find path specified" ..

The main Dir Im trying to work with is located:
C:\Users\AV Masters\Video\Edits
I created 2 test folders (DIRS) under \AV Masters\ .. called AVTEST1 and AVTEST2
AVTEST1 contains a sub-Dir named "AV" which contains some sample videos to test this copy process..

What I'm trying to accomplish:
Create one main folder (Dir) with a sub-Dir that contains the video files I want..
Whenever I need to create a new folder/Dir somewhere or copy an …
The original filename is "test.txt".
The requirement is to append the date + Timestamp (format yyyymmdd_hhmmssmsi.txt) at the point the file "test.txt" is generated.

yyyy - year
mm - month
dd - day
ss - second
msi - milli-second
Hello Experts,
I am staying at a hotel for a month (work travel)
My laptop is connected to the local wifi.

I need to map a local folder in my laptop as m:
since many applications i have need to use that mapping in order to work

Now not being an expert, first I erased all sharings from COMPMGMT.MSC
fearing someone in the hotel may access my laptop....

then I shared the local folder and added a local user with full rights to the shared and security properpties...
But no I cannot access the folder when i go through NETWORK in win explorer..
and cannt either map the folder although i can see the folder name under its computer in the network...

What can I do so i can map this local folder and havng only my laptop access it ?

PD working with win10, toshiba laptop core i5
I don't have xcopy for Windows 2000.

I want to write a super simple DOS bat file to do this daily:
1) Copy all files in C:/SourceDirectory and in C:/SourceDirectory2 to D:/DestinationDirectory that are created or modified after and including June 1, 2017.
2) Create a copy of  D:/DestinationDirectory and rename it as DestinationDirectory_MMDDYY where MMDDYY is the current month, day and year.

How do I do this?
Efficient way to get backups off site to Azure
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

No comments, but we're still running WordStar v.7 as our main word processor. We operate the 32-bit version of Windows 10, and we physically print letters from WordStar via a PCL driver (mapped to shared Windows printers). This works fine with all of our printers except one - our Canon iR4570 copier.

Our main copier has just gone to the wall, so we're down to only one LaserJet that can carry out this function. Obviously I want a bit more redudency than this.

We run Wordstar as a legacy app through the ntvdm.exe process we've installed with Windows 10 32-bit. If I send a print job via PCL to the iR4570 it generally never prints anything, and the touch-screen concole becomes unusable. It is like it is running a corrupt process that is consuming all memory and/or CPU cycles . The only way to recover is to physically switch the iR4570 off.

On very rare occasions, it does start printing, but just junk text comes out - either filing the page, or just a couple of letters at the top of each page. It'll print until the trays are empty.

If I print to the iR4570 via PostScript from Wordstar, it is absolutely fine. HOWEVER, PostScript fonts are slightly bolder, and it doesn't look quite right for our requirements.

The iR4570 has a pretty much identical firmware to our other copier that went to wall, and which handled this all fine with PCL printing, day in day out, until it's demise. I'm hopeful there is something just not right in the settings I can flush out - but before…
I use Ola Hallengren's maintenance for all of my customer's,
Have used it for years, never any real problems -- until now.  For some reason the @CleanupMode and @CleanupTime are not working. The backup step is configured to retain bak files for only 24hrs, and to cleanup the old bak before generating the new.  For some reason, it is not working, and the job keeps failing due to insufficient disk space.

My temporary workaround is below.  I am deleting the largest bak file from disk as a first step in the job, until I get Ola's logic corrected.  Well, it works great as-is, but I've found I need to run it for all subdirectories.

The way it works now is to del the bak file in this path explicitly:
SET @path = 'dir \\backups\servername\dbname\FULL\'

I need it to delete the bak files from all subdirectories within \\backups\servername\

Any help?


IF OBJECT_ID('tempdb..#files') IS NOT NULL
DROP TABLE #files;
CREATE TABLE #files (Line VARCHAR(512)) 
DECLARE @filename VARCHAR(255)
SET @path = 'dir \\backups\servername\dbname\FULL\'
SET @cmd1 =  @Path+' /A-D  /B' 
--PRINT @cmd1

INSERT #files
EXEC master..xp_cmdshell @cmd1
--SELECT * FROM #files

SET @filename = (SELECT Line FROM #files)
SET @cmd2 = 'del \\backups\servername\dbname\FULL\' + @FileName
--PRINT @cmd2


Open in new window

Hi Experts,

I am trying to figure out why when I create a new ADP and set the connections properties to my server (SQL 2008) then it goes fine, however if I take my old ADP and try to modify the connection to use the new server I get the attached error.

BTW, I had someone looking into this today and he was using netstat - na find "XXXX" to see where is that trying to connect to, wondering how do I use that command?

Thanks in advance.
is there a DOS command to run to get list of all NT group that contain a certain word like 'sql', 'Reporting' etc.
Amazon Music, for reasons only know to them, downloads the following file

          Mason Williams - Change the World.MP3

renaming the files during download as follows:

          01-02- Change the World.MP3

I know restoring the artist's name is going to be difficult, but how do I batch rename...

          01-02- Change the World.MP3     to     Change the World.MP3
          01-04- Hello, Goodbye.MP3          to     Hello, Goodbye.MP3
          02-02- Ticket to Ride.MP3             to      Ticket to Ride.MP3

In other words, stripping the 0?-0?-   from the front-end of the filename.

I have tried several iterations of REN such as REN  "0?-0?-*.MP3"  "*.MP3",  but nothing I do seems to work. Suggestions?
Thanks to the way Amazon Music downloads MP3s, I have 704 files in 592 directories. I want to copy all of the files into a single directory. I tried a utility called XXCOPY. All the files copied to one directory but in doing so all of the filenames were modified to contain the directory structure. Poor solution. Anyone have another idea?

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.