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.

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

Sign up to Post

Hello experts,
I am looking for two batches that
1-delete /f based on a csv file.
2-rmdir /q /s based on a csv file.

-Full path of files to delete and remove directory will be reported in column a
-Two different batches or CMD and CSV files one for rmdir.csv and the other del.csv.

Logs files should be generated in order to check what has been removed.
Rmdir just remove reported folder and not parent folder.
/S option should be set up to remove subdirectories of reported folders.
 If you have questions please contact me.
0
I have a  script that merges files into a subfolder and then asks me if a chiltern or BTP download and depending on if I push Y or N depends on what happens.

This is fine but what im trying to do is when I push "N" for both of them I need the folder moved to "E" drive so I can burn to disk .

Everything is OK apart from the last bit where I instruct it to move to "E" drive.   Whats happening is that it moving the folder but not appearing in "E" drive where you normally drag folders over to before burning.

What it is if I select "N" for both  BTP and CHILTERN I need it moved to "E" drive where you drag folders before burning and then all I go to do is click on "BURN TO DISK".

Any Ideas?

echo off
setlocal EnableDelayedExpansion

rem Define folder paths
set BaseDir=X:\DOWNLOADS
set DestDir1=X:\BTP DOWNLOADS
set DestDir2=X:\CHILTERNDOWNLOADS

rem Quit if no files in download area to process
set Empty=Y
for %%A in ("%BaseDir%\*.*") do set Empty=N
if "%Empty%" EQU "Y" (
    echo No new files to process, quitting.
    exit /b
)

rem Prompt for reference number
set RefNum=
set /P "RefNum=Enter reference number (blank to exit):"

rem If none entered, exit script
if "%RefNum%" EQU "" exit /b

rem Make a subfolder for the reference number
md "%BaseDir%\%RefNum%"

rem Move all files to new subfolder
move "%BaseDir%\*.*" "%BaseDir%\%RefNum%"

rem Ask if BTS download to determine where to move the new folder
choice /C YN /M "Is this a BTP download (Y/N)?"
if 

Open in new window

0
Dear all
We received xml documents from our partner that could be easily be opened manually with excel document. With output  format xlsx

We are looking for DOS or powershell based script that we can used to automate the conversion.

Any ideas how the script might look like. or some tutorials, that could help us solve this issue?
0
My co-worker working on an old app and he need to make some updates to a DOS app. I haven't work with DOS in years and to avoid the learning curve I was hoping someone can assist. I need to setup a variable in DOS and looking to get some help on setting that up.  Any help would be greatly appreciated.
1
Trying to run

        Dim RetVal As Long
        RetVal = Shell("for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO @if exist %%i: dir %%i:\*.* /s /b >E:\zzz\Zip-Bak\DayBkUp\DirectoryListHistory\%%i.txt")



Get error run time error 53 file not found?

It runs fine in a dos batch file

Trying to create a series of text files with a list of all files on each drive on my computer

Thanks
DIR-ALL-Drives.txt
0
I had this question after viewing Printing on Network Dot Matrix Printer from MS Dos based program in XP.

What if LPT1 is already disabled from device manager, and still we are not able to give print from dos on dot matrix printer on network.
0
I had this question after viewing batch findtext match 2 criteria.
i am still playing with the above, however now i am having an issue while searching a csv i need to look for "DS" & "DSA" including the ", is there a way to accomplish this using findstr
perhaps with a double "
/c:"""ds"""

Open in new window

0
Dear Experts

Please can someone assist me. I would like to run a batch file on remote machines as an administrator. The batch file is located on a share that is accessible to everyone.

I am  trying to use psexec.

I am trying this but it doesnt seem to be working:

PS C:\Users\navishkars\Desktop\PSTools> .\PsExec.exe \\agent47-pc -u mydomain\admin-navishkars -p password cmd "\\dbnfiles\Software\DB2-ODBCClient\1_clidrivercopyandinstall.bat"
0
I am trying to take an input string, extract the second through ninth character and use it as a directory name.  This is real DOS I'm talking about, not a shell in Windows. This is real boot up to a C:\ prompt DOS from a Windows 98 boot disc.  Windows is non-existent on this system.

I tried:

set test=123456789012
echo %test:~1,9%

Open in new window


But it just returns "ECHO is on"

I want to see 23456789, so I can then use it to create a directory named 23456789.

The end goal here is to create a batch file which I can launch with the string as an argument.  Then I would create a directory and take the results of the batch file and copy them into that directory.  Every time I run this particular test, it will overwrite the results, so I need to move them into a meaningful directory name each time.
0
Hello Experts,
I am trying to run a set of DOS commands from C# program, which need to be executed in a Windows Service.  It runs fine in Development machine and Test Server.  But when I deploy that in Production, it does not run.  When I say it does not run, only DOS portion does run.  The C# part runs just fine.  Any idea, what is going on?  Is there a way I can capture any exception?  Any help is highly appreciated.

Thank you very much in advance.
0
Hello Experts,

Using this batch how to print %sum1% in words along with numbers

@echo off
:Loop
echo Enter a number:
set /p num1=  
set /a sum1="num1 * 100000"
echo The total is %sum1%
goto :Loop
0
Dear Experts, is  there any method to check the uninstalled apps in a PC/laptop? Can we do it via CMD or powershell?

Many thanks in advance!
0
We have a storage in production and one storage in DR site. The link between sites are not strong enough to support replication.
How to copy last  1 day or 2 days files from production storage folder to External HDD using a script.
Then copy HDD to DR storage.

Appreciate
0
We have some upgraded going on some of our web severs.
Till that time we need check many urls manually daily.

I want to write a vb script to check urls if it is up or not and send us status report through mail.

urls address start with https:// and we need to use F5 Token and disable proxy setting to connect those server.

we don't have power shell access as well.

could somebody please help me to write a vbscript or bat script to automate these stuff.
0
Hello Experts,
How can I run multiple DOS commands inside a C# program?  1. The first line should change the directory to FolderOne.  2. In FolderOne, I need to execute an XXX.Exe file. Please let me know.  

Thank you very much in advance.
0
A lot of folders can be robocopy to another server recently. The following errors are logged. Any idea ?

Thx

2018/05/02 03:12:36 ERROR 64 (0x00000040) Scanning Source Directory Z:\Tsegxxxxx\
The specified network name is no longer available.


2018/05/02 03:12:36 ERROR 64 (0x00000040) Accessing Destination Directory D:\ARCH17\Tsegxxxx\
The specified network name is no longer available.
0
I want to rename all of Mp4 files to 1 2 3 4 5 6 7 ... so on

but the numbers sequence should be based on the created date-time   so all of my files are created today but their timing for creating them are different.

so 1 should be the name of the latest time of creation of the Mp4 and then 2 should be the name of second latest created

how can i do this automatically?
0
Hi guys,

I would like to rename multiple files by replacing the name by their first 19 characters of their old name.
Can you please assist.

Orginal file naming:
0000000000000376279.xml.3be03b33b7fd403bb03fe27fd1167ffc.error
0000000000000376280.xml.7c157a6cecf644cf934e919292339904.error
0000000000000376281.xml.80d7062d6cbc4c689d7c82c1e6ec35c7.error
. . .
. . .

I want to achieve:
0000000000000376279.xml
0000000000000376280.xml
0000000000000376281.xml
. . .

script used in CMD doesn't work
exception: command is incorrect

ren -n 's/(.{19}).*(\.error)$' *.xml

Open in new window


Thank you
Darius
0
I need to create a batch file that backs up a file then deletes the original file so that I can download a file with the same name.

As follows:

del myfileBackup.csv
copy myfile.csv myfileBackup.csv
del myfile.csv
...
myapplication --username --password --formID  --output myfile.csv

The problem I am running into is when a file is deleted/renamed it ties up that file and prevents the next step.

I get an error message

The process cannot access the file because it is being used by another process.

This caused my import/download to fail.

I appreciate any help that can be provided.

Thanks!

Michael
0
Hello All,

I come to you because I need your help!

Currently I have a Batch and Script, which allows me to change the wallpaper automatically and randomly to all users of the domain, both work changing the images, however I have noticed that sometimes repeats a wallpaper without finishing the cliclo of xx images published in a folder.

Greetings and thanks from the atheist for your valuable help!

Richard
0
I would like to use a batch file to send an email via a SMTP mail server with attachments.

I have all the settings because I use the SMTP within my SQL server.  The purpose of this  batch file is to take a 'txt' file and forward it to a recipient.  One other wrinkle is that it has to be conditional based on the value within a file, Y or N.

Is this possible?

Thanks

Glen
0
I am trying to delete a text file from all of the user profiles within the c:\Users and F:\Users on a Windows 2008 r2 server, using Del /q /f /s c:\users\%user profile%\folder1\folder2\*.txt. which does not work, and the error says path not found.   I need to delete the text file from all the users folders on the server.

how can I make it work.
0
I am having trouble with a variable in a batch file. I am setting a variable with special characters, and having trouble getting them to print.

One of the two special characters is %. That one, I got to print by putting two of them in the variable. (aka % became %%) The other character is ^. I have seen that ^^ should work. But, it does not.

The (literal) string that should print is:
P%@AP[4\PZX54(P^)7

Batch file I am using:
@ECHO OFF
SET location=P%%@AP[4\PZX54(P^^)7
ECHO %location%

My output is:
P%@AP[4\PZX54(P)7

<Missing the ^>

Might I need to escape the ()'s somehow?
0
Windows batch scripting & Del files in multiple directories

I want to delete *.dmp & text files from within the user profiles.      “What command or commands in a script can do this ? “  Because they will be put into the Windows task scheduler for automation.

Location of the files are in the AS400 folder. This is the full path.
H:\USERS\userProfiles\IBM dump\AS400\*.dmp and *.txt.

Note: The environment is Windows 2008 r2, in an Active Directory environment.  userProfiles  contains all of the “different user folders”  who are on the network.

The problem I have been having is bad info claiming to work that is tested and Does not work.
0
DOS FTP access script

I am using this command:
ftp -s:ftp.txt
ftp.txt is this:
open 000.000.000.000
MyUser
MyPassword
lcd c:\_A
put TR.bak
quit

I get this response:
ftp> Connected to 000.000.000.000.
open 000.000.000.000
220 Microsoft FTP Service
User (000.000.000.000:(none)):
331 Password required for MyUser.

530 User MyUser cannot log in.
ftp> Local directory now C:\_A.
ftp> lcd c:\_A
put TR.bak
530 Please login with USER and PASS.
530 Please login with USER and PASS.
ftp> quit
221  

the password is correct. What am I doing wrong here?
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.