We help IT Professionals succeed at work.

# Microsoft DOS

13K

Solutions

12K

Contributors

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.

Hi

Please can you help me convert a file call distlistcontacts.xlsx to distlistcontacts.csv located in c:\o365update\ via command prompt.  I have tried a scripts on the web and cant get them to run. Excel is not installed on the pc where the batch file will be scheduled to run from .

Regards

Simon
0
My client asked me to get the programs and data from an old PC.   Its an old 386/486 that defines the tracks, sectors and cylinders in the bios.   (an IDE drive with no partition table).   I tried connecting its drive via USB to a newer PC, but none of the data is visible using windows 7, Windows XP, DOS 6.22, Hiren's boot disk, etc. on the newer PC,  probably because there is no partition table.  Its too much data (over 30gb) to try to copy with 750kb or 1.4mb diskettes and those PCs don't have CD drives.

I was able to get a sector by sector image copy to a USB drive -- And plan to try to restore it to a newer drive, but I doubt that will solve anything -- since it will probably restore without a partition table.

Many years ago I used to have all sorts of great DOS based tools for this sort of thing.  Some may still exist in my basement or one of the software archive sites, but at my age, I don't remember which to use or how they worked.   I'm guessing an old pre-Windows XP might be able to read this data and be able to write to a partitioned drive (I don't believe those old versions knew about USB).

Any help would be much appreciated.
0
Hi,

I am looking for dos command to force delete file/files by its name from folder. No matter any user uses/open that file. I don't want all files in the foleder get deleted when I run this code. Thats the reason why I am asking for a code where I can put file names and that code will delete the files I needed.

Thank you
0
Hi,

I have a source file named 'Get_SubVar_Yr.log' that has these three lines:

Processing...
ALL.Act_Yr=FY18
getsubstvar completed successfully

I'm trying to set a variable equal to the value after the = on the 2nd line.  So my variable named 'theyear' would equal 'FY18'.

for /f "tokens=1,2 skip=1 delims==," %%A IN ("D:\Get_SubVar_Yr.log") DO @echo %%B


I'm not sure how to resolve the 'delims==' part to start.  Is that possible?
Also do/should I need to skip the first line and did I get that correct?
Will the 3rd line hose anything up?
Is For /f   the correct method in the first place?
1
What is the WMIC command to get the Server/machine SID, not the domain SID?

I keep reading how to get useracoount SID or using Powershell.

What I require is using WMIC command only.
0
What does the double percentages before the numbers mean? "%%3%%8%%9.CRL"

CERTUTIL -SETREG CA\CRLPUBLICATIONURLS "1:%WINDIR%\SYSTEM32\CERTSRV\CERTENROLL\%%3%%8%%9.CRL\N2:http://pki.ECHOs.com/certenroll/%%3%%8%%9.crl\n10:ldap:///CN=%%7%%8,CN=%%2,CN=CDP,CN=PublicKEY SERVICES,CN=SERVICES,%%6%%10"
0
is there a way to add to the windows credential manager via the command prompt
I'm not referring to cmdkey but the actual windows credential manager apparently they are not the same thing.
it works fine it I run mstsc /v:server
but if I run it from the desktop by clicking on a shortcut it prompts me for the password; however, if I put the credentials in windows credential manager I do not get the prompt

so, is there a a command to add a username and password to windows credential manager ?
I don't want any user interaction I want to run it through a bat script or psexec or something.
Thanks!
0
Hi Experts,
I'm looking for either code or script that will do the following
loop thru all files of specific folder, not including sub folders (folder should only contain CSV files).
delete all the contents of those files, but do not delete the file itself.
Thanks
0
I have a few thousand files and the processed equivalent files in a folder  ( Windows Server 2016 machine).  But there are a  few files which missed the processing
An example list will be
Doc1
Doc1.Timestamp.lck
Doc2
Doc2.Timestamp.lck
Doc3
Doc4
Doc4.timestamp.lck

IN the sample, Doc3 is not processed. How can I get the list of   files not processed  when the list is huge?
0
Windows Batch file to count a set "N" number of files from a single source folder,merged multiple files together into a single output file that contains <= N number of records, and move processed files to a save directory folder.

Request for a window bat file that can be run from command/CMD prompt.  Windows 7 environment.

Windows Batch file to copy a set "N" number of files from a single source folder to an output file, move processed records to a single save folder.  The single source directory may contain 1 up to a million files.
Need to copy 200 files at a time to a newfile_N+ that should contain <= 200 files per newfile_N+ until all records have been read and processed.

Input file extension: *.hl7
Output file newfile_N+ extension: *.txt

Source directory - C:\temp\source
Destination directory - C:\temp\output\newfile_N+.txt
Destination directory - C:\temp\processed

For the purpose of demonstration I have attached (5) sample hl7 files.
Each newfile_N+.txt file should contain <= 2 records per file.

Prior to kicking off the batch file.  All (5) source files would be all be in the (C:\temp\source) directory.
Upon completion of the batch program running.  The expected output once the bat file has run would result in the following:

C:\temp\source
dir: contains no files *.hl7 files

C:\temp\output
dir: newfile.txt, newfile1.txt, newfile2.txt
Note: Each of these files contains <=2 records each, max is 2 records per file
==> newfile.txt …
1
Anyone have a good solution to rename recursively all the files in a directory tree that begin in _ or contain ()!\$% etc?  I am trying to start a massive FTP upload but it fails due to the names.  I have already used CMD to recursively remove temp files and such but the ren command doesn't work recursively.
0
Request for a window batch file that can be run from command/CMD prompt.  Windows 7 environment.

Windows Batch file to move a set "N" number of files from a single source folder to a destination folder.  The single source directory may contain 1 up to a million files.  Need to copy 200 files at a time to a destination folder_N+ that should contain <= 200 files per destination directory.

Once all the files are moved to the destination folders, would like to merge the multiple files per individual destination folder into one single file. (copy *.hl7 newfile.hl7)

File extension: *.hl7
Source directory - C:\temp\source
Destination directory - C:\temp\outputN+

For the purpose of demonstration I have attached (5) sample hl7 files.
These (5) files would be all be in the (C:\temp\source) directory.
Expected output would result in the following:

C:\temp\output
dir: new 1.hl7, new 2.hl7
copy *.hl7 newfile.hl7

C:\temp\output1
dir: new 3.hl7, new 4.hl7
copy *.hl7 newfile.hl7

C:\temp\output2
dir: new 5.hl7
copy *.hl7 newfile.hl7

Note: The folder names may contain spaces, also the file names may contain spaces.
source.zip
0
Hi Experts,

I have the following command running as a batch file (on task scheduler) in an hourly bases.
xcopy "C:\Users\bfuchs\Dropbox\Caspio\caspiotables.zip" f:\Conversion\Caspio\ /y


would like to have this running in another pc as well as a backup.

However would prefer to have the following modifications

1- To first check for date/time that file f:\Conversion\Caspio\caspiotables.zip when it was modified, if it was not within the hour then perform the task.
2- Get an email informing it was done (so i know the 1st one failed).

0
Hi

I am in search for dos command which I need to include in the batch file. The code I am looking for is to copy excel files from a Upload folder and paste it in the archive sub folder(which sits in Upload folder). Each time I run batch file, it should copy files from Upload folder and paste in archive folder. If the files with same name exist inside archive folder, the dos command should over write only those files with latest files, leaving other files as they are.

Hope you get my point.

Any questions please let me know.

Thank you
0
Hi,

I am searching for a dos command which can cut files from a given folder and paste those files in to an Archive folder which sits along side with the files need to be uploaded into. There are folders with space in its name. I have to insert this command in a bat file. I use below code for my other tasks and its working fine, but it does not do cut and paste, it does copy and paste.

@echo off
setlocal

echo Start Copy

set SOURCE_DIR=C:\Nat\Reports\Reports
set DEST_DIRS="X:\", "N:\Reports\Production Repts\Reports"
set FILENAMES_TO_COPY="2018All Projects_New.xlsx","2017Report_New.xlsx"

pushd "%SOURCE_DIR%"

for %%F in (%FILENAMES_TO_COPY%) do (

for %%D in (%DEST_DIRS%) do (
echo file "%%~F" to "%%~D"
xcopy /Y "%%~F" "%%~D"
)

)

popd

echo. Done.
exit /b

Thank you
A
0
BATCH FILE:  The following command overlooks and does not copy files in directory  D:\Thunderbird

xcopy "D:\*.*" Y:\JKB\Backup\D\ /d /s /r /y /f


Other files in other directories are copied.

Any ideas???
0
Hi Experts,
How to grep connected tcp IP & Port connection then forcefully kill using batch.

example;-
netstat -a output is

Active Connections

TCP       192.168.1.101:49366            192.168.1.55:65000          ESTABLISHED
TCP       192.168.1.101:49475            192.168.1.55:64000          ESTABLISHED
TCP       192.168.1.101:49384            192.168.1.55:63500          ESTABLISHED
TCP       192.168.1.101:49396            192.168.1.55:22                 ESTABLISHED

Need to forcefully kill all TCP connection which is connected with 192.168.1.55
0
Hi Experts,

I have this question after resolving the following

How can I modify the command to

2- include only files created in specific date range
3- include only files with specific names, like "*PatSched* and "*PatChanges*"

0
Hello,

This is a follow-up to another thread located here:

Create an executable file to open a non-executable file

In that thread, expert Joe Winograd provided a solution which involves creating an AutoHotkey (ahk) "Run" command (which I know how to do) then compiling the resulting .ahk file to create an .exe file. That was a great solution and I'm glad to now know how to do that. However, since closing the previous thread, I've realized that that solution is not practical for the specific purpose* that prompted my question.

As a result, I'm back to my original question which is:

How do you directly create an executable file (.exe or .cmd) to open a non-executable file (.xlsm, .txt, .ahk, etc)?

In the previous thread, expert tuvi suggested putting the following in a .cmd file:

start C:\Users\UserName\FolderName\FileName.xlsm

Unfortunately, while I know how to place a command in the cmd/prompt/DOS window (not sure what it's called), I do not know how to create a .cmd or .exe file. I tried simply pasting the above line in a Notepad window then saving it, first with a .cmd extension and then with an .exe extension but neither of those worked.

It seems like something I should know how to do but that's why I'm happy all of you great experts are available to answer questions. :)

Thanks…
0
Have a user that started saving long file names and folders creating problems on a 2012 Server. File path has exceeded 280+ in length luckily there are only 5 folders affected. Problem is I created a virtual directory to the folder using Subst command, however I get this error when I try to rename it.

I tried Subst in administrator mode but the drive doesn't show, a known issue.
I tried without administrator mode and the mapped drive shows however I get the above error.
0
I have one folder "destination" where I have files and their time stamps (created, modified) I would like to preserve when I overwrite a few of those files with updated version of those files.

example

Destination Folder
File.mp4- Created 01/01/01 (size 500mb)

Source Folder
File.nmp4 - Created 12/12/12 (size 4.00gb)

I overwrite the file in the Destination folder with the new updated version from the Source Folder but keeping the original file in the destination folder timestamps

End Result (new overwrite file in the destination folder with original file timestamps)

Destination Folder
File.mp4 - Created 01/01/01 (size 4.00gb)


I have written a batch file to move the file as so

robocopy "Source" "Destination" /E


and this handles my overwrites and moving of my files perfectly, but I haven't found a way to preserves timestamps. I am looking for command-line so I can implement it in a batch file. Any help will be appreciated. I been reading flags for robocopy etc but maybe I'm reading it wrong or something but I haven't figured it out yet.
1
Hello,

How do you create an executable file to open a non-executable file?

I just began using a Corsair K95 RGB keyboard (which includes 18 programmable G-keys) along with its software (CorsairUtilityEngineSetup_2.24.50_release). While assigning macros to the G-keys, I discovered that while the software does allow you to run an executable file (*.exe *.bat *.cmd), there is no option to open a simple non-executable file (eg .txt, .xls, .ahk, .png, etc).

That seemed a bit odd to me but it was confirmed by Corsair tech support so during the conversation I asked about possible workarounds and the response was that I could create an .exe or .cmd file to open the desired non-executable file.

So for example, suppose you want to open the following Excel file:

How would you create an .exe or .cmd file to do that?

Thanks
0
Hi Experts,
I have the following batch file
@echo off
setlocal

set  tm=%time: =0%
set  tm=%tm::=%
set dt=%date:~10,4%%date:~4,2%%date:~7,2%

copy  C:\Users\bfuchs\Dropbox\Caspio\CaspioTables.zip  h:\CaspioTablesDaily\CaspioTables%dt%%tm:~0,4%.zip

copy  F:\Data\SkilledNursingVisitNotestbl.mdb  h:\AccessTablesDaily\Skilled_Nursing_Tables%dt%%tm:~0,4%.mdb


Would like to have for the second file (the access file), to zip it into the destination, instead of just copying.

How can I accomplish that?

fyi- I have windows 7.

0
Hi Experts,

We have windows server 2008 along with multipal users they have only remote desktop rights & i dont want assign administrator rights,

but a there is a software which need administrator rights (run as administrator) permission to execute from users, we had manage till startup time manually to run as a administrator with password but now there is more than 50 users that's why i can't manage manually.

I need a batch file which have store administrator password, I'll paste that batch to every user Desktop & locate the software path to in batch file run as administrator.

Path Example :-
for user1
D:/user1/Gm_4.1.1.1_05082018_PAN/EnhanceT.ext

for user2
D:/user2/Gm_4.1.1.1_05082018_PAN/EnhanceT.ext

for user3
D:/user3/NEW_4.1.1.1_12082018_PAN_A/EnhanceT.ext

for user4
D:/user3/Gm_4.1.1.1_05082018_PAN/EnhanceT.ext

for user5
D:/user5/Gm_4.1.1.1_05082018_PAN_5/EnhanceT.ext

for user6
D:/user5/Gm_4.1.1.1_05082018_PAN_6/EnhanceT.ext
0
Hi
I need to rename some files

This works if I cd to the directory first

cd \s z:\Path\with\files\in
ren *.jpeg *.jpg


How do I write a simple bat file that takes the parent folder as a parameter and recursively  renames the files skipping over if the files exist

so if a folder had both MyCat.jpeg and mycat.jpg  it won't over right mycat.jpg (Windows file names are not case sensitive) and won't prompt
0

# Microsoft DOS

13K

Solutions

12K

Contributors

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
Monthly