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

I'm trying to create a batch file that will add the current date to a file. I found this online - but it only works when you enter it directly on the command line
for /f "tokens=1-5 delims=/ " %d in ("%date%") do rename "filename.pdf" filename_%g%e%f.pdf

If its in a bat file I receive this message
dategf.pdf was unexpected at this time.
screen shot of running commands
I'm looking for a solution and I'm not tied to this one if you have a better option.

Thank you!
0
Exploring SharePoint 2016
LVL 13
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

Hello experts,

Please can you explain me exactly what this command does ?

/C copy /b Image1.jpg + Archive.rar Image2.jpg

Best regards
0
Hi,

I'm looking to copy a folder from one location to another. The destination folder does not exist.

How can I do this with Xcopy?

The following will copy all folders within sourcefolder, to destination folder, but that's not what i want.

Xcopy /E /I   c:\temp\sourcefolder  T:\temp\destinationfolder\

I want to copy folder sourcefolder to a new folder within destination folder.

Any help much appreciated.

Thanks


MS ref: https://support.microsoft.com/en-gb/help/289483/switches-that-you-can-use-with-xcopy-and-xcopy32-commands
1
Hi Experts,

This is in regards to the following question.

https://www.experts-exchange.com/questions/29154904/List-PC-Names-and-browser-versions.html#a42927703

In addition, that script only works for IE, I would like to add check for Chrome, Safari and Firefox as well?

Whoever has an answer kindly post it here.

Thanks
0
How do I control the information displayed in the dos window header?

If I run a batch file, it will display the name of the batch file in the header of the DOS window which it is running in. Also if I pass parameters to the batch file, it will display the name of the batch file followed by the parameters values passed. So how can I prevent batch file name and input parameter from being displayed in the header, when the batch file is running?
0
In the DOS command window, after my dos command or batch file has completed it's run, I would like for the dos window to close. Does anyone know if there is a command which will close the dos window after the command file has completed it's run?  You see I am not allowed to change the command file "mergeStrayFiles.cmd", so I cannot place a close dos window command inside of my .cmd file. So somehow dos needs to close the dos windows once the command file has completed running.




>mergeStrayFiles.cmd
0
I have the following batch file now I want to add STEP 1 STEP 2 if STEP 1 FAILED then goto next step and send email or generate output in txt

powershell.exe -executionpolicy bypass -file J:\Backup\EnableTCP-IP_Named_Pipes.ps1
powershell.exe -executionpolicy bypass -file J:\Backup\Restart-SQL_Server.ps1
if errorlevel 1 echo Unsuccessful > J:\Backup\result.txt
if errorlevel 0 echo command executed successfully > J:\Backup\result.txt

Thanks
0
Hi Experts,
I am looking for a program that will list all PC names, browser names and versions within the network.
Would prefer it to be done either as a DOS command, batch file or VBA.
Thanks
0
Hi Experts,

How can I modify this DOS command to only look at files created after a certain date?

Thanks
0
If I am in DOS, how do I find out specific documentation about a dos command? For example I want to find out about the dos command /k switch which can be used to prevent a dos window from closing when called from an application.
0
Become a Microsoft Certified Solutions Expert
LVL 13
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

I am running an SQLCMD command from DOS against a SQL Server 2008 database that occasionally outputs the following message at the end of the data:
"WARNING: Null value is eliminated by an aggregate or other SET operation."

I do not control the DB and do not want to fix the error, I just want to suppress the warning message.
I know the default ERRORLEVEL is 0.
If I add the output parameter -m1 this warning disappears.  This is what I want because the output is read by a different program and does not expect messages at the end.

But it raises a few other questions for me:
1.  What ERRORLEVEL values exist in SQL Server?
2.  Do they mean anything?
3.  Is there a maximum (if I want to suppress any/all errors)?

Thanks!
0
Hello,

I am trying to create a batch file in windows 10 that would delete all files & folders from a specific folder and its sub-folders that there modified date is prior 5/23/2019.  I have used DateModified:<5/23/2019, then highlight them, then delete them, but for some reason next time run DateModified:<5/23/2019
 to make sure all prior 5/23/2019 has been deleted, more are displayed.  Also tried placing *.* then sorting by date but since so many files, takes super long but also after deleting, I search again,more files prior 5/23/2019.  I also tried ForFiles but also, no success.

Help.
0
Running MySQL 5.7 on Windows 7 Pro.

I have searched Experts Exchange before posting this question. I cannot find a suitable answer.

My question:  
I want to automatically backup my Mysql database using  a command line so it can occur automatically.
I want to add the date and time to the dump file name.  For example:
 
c:\Program Files\MySql\MySql Server 5.7\bin>mysqldump -u root -ppassword –databases dbname > mysqlbkup13-June2019_02:00.sql

The date should be in dd-mmm-yyyy format.  The time should be in 24 hour format.
I am not a DOS expert so I don’t know how to convince DOS to add the date and time to the output file name.  

Could someone please tell me how to do this?
0
Hello,
I am tried to copy folder structure from folder a to folder b exlcuding all files.
I don't understand why files are copied with the following command:
robocopy folder a folder b /e xf *.*

Open in new window

Thank you
1
Hello,

What is the best way to deploy PowerPoint template throw GPO for whole domain users.


I have 3 files for use :
.cmd
.msi
.cab

the cmd file containe:

@ECHO off
SETLOCAL
SET TSManager=TSManager.exe

TASKLIST /FI "IMAGENAME EQ %TSManager%" 2>NUL | FIND /I /N "%TSManager%">NUL
IF "%ERRORLEVEL%"=="0" GOTO TaskSequenceDeployment

:ApplicationDeployment
MSIEXEC /I "%~dps0PowerPointTemplate.msi" /L*v "%temp%\PowerPointTemplate_1.0.0_Eng.log" ALLUSERS=1 REBOOT=ReallySuppress /qb-!
SET RETURNCODE=%errorlevel%
EXIT %RETURNCODE%

:TaskSequenceDeployment
MSIEXEC /I "%~dps0PowerPointTemplate.msi" /L*v "%temp%\PowerPointTemplate_1.0.0_Eng.log" ALLUSERS=1 REBOOT=ReallySuppress /qn
SET RETURNCODE=%errorlevel%
EXIT %RETURNCODE%

Thanks
0
I have two large batches of programs - several years work - in QuickBasic and Fortran IV .
I need to update these to a more modern language (Python?).
Are there any automatic translators?
where would I find them?
0
Is there a Dir command line option to search for a file or folder under a directory but exclude a specific subfolder in the search? dir /b /s ??
0
Dear Sir,

I am writing a script to ping multiple computer (hostname) at Dos prompt. A text file which contains multiple hostname. I would like to redirect the result to a text file and named using date and time.

Please advise. Thank you.

With regards,
Wataw
0
Hi,

I need to create a parameterized dos script then call it through a function.

So the string is :
&execString = "E:\NC_SCRIPTS\GeneralInvoice\GeneralInvoiceRPT.bat " | &RnCntrolID | " ";

I need to express the variable in here so it picks up the value correctly and not as a string.  
Are the quotes correct around my expression above?

Thanks, Brock
0
OWASP: Forgery and Phishing
LVL 13
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Need assistance with using ROBOCOPY on Windows Server 2016 Datacenter. In the past, prior to Server 2003, the /mov or /move switch would simply move the data, including files and folders inside a directory to another directory specified in the command. However, now it deletes the source directory after executing the move, see the command below:

ROBOCOPY "C:\(path)\Upload" "F:\(path)\Upload_Completed" /MOV /E /NP /LOG+:"C:\Scripts\movelog.LOG"

The "Upload" directory is deleted once the command completes. I DO NOT want the "Upload" directory deleted. I ONLY want to move the files and folders to the "Upload_Completed" directory. Is there a better way to achieve this goal. Please advise. Thank you.
0
Need CMD command for tasklist to sort Mem Usage in descending order?
0
I need to verify if a drive exist prior opening a windows apps.  I was thinking maybe using command prompt batch or powershell batch file to do this.  I want to have that code verify if drive J exist and if so, execute the windows apps.  If doesn't exist, then exit the routing messaging "Drive has to exsist".  How can I do this?
1
I am creating a batch file to automate certain tasks along new PC deployments.

I have a custom power profile exported for my Dell machines. The file name is powerplan.pow

When I execute the command: powercfg -import "powerplan.pow" it returns

"Imported Power Scheme Successfully. GUID: 5c534448-baa1-47f2-8838-a83d7ef6928d.

The next line in the batch file would be: powercfg -setactive 5c534448-baa1-47f2-8838-a83d7ef6928d

How can I grab the GUID value returned from the "powercfg -import 'powerplan.pow'" command and append it to the powercfg -setactive <GUID value>" command?
0
I have a  1 line batch command file(tbd.bat). In the batch file there is a line which is used to set/ create a time stamp.  When I run this batch file on Windows server 2012 the batch file works perfectly. However if I run it on my local PC, it isn't working. instead it just echoes the command to the screen.  Does anyone have any idea why it won't run on my local pc, and only on the server? I have also tried it from another local PC, and again it only echoes the command

tbd.bat :
set timestamp=%datetime:~0,8%_%datetime:~8,4%

On windows server 2012 the output from running the batch  is : set timestamp=20190212_1201

On my local PC the output of running the batch  is : set timestamp=~0,8datetime:~8:4
0
Hi,

Please find the MS Dos command below. I am trying password protect a file. I am looking for a MS Dos command to do this (I need to include this command in a bat file)

@echo off
attrib +r -a -s -h "C:\Rep\MonthlyReports\abcd.xlsx"

Please let me know.

Thank you
A
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
>