Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x

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 would like a batch file to copy, lets say the word : magic.  After I double click on the batch file on my desktop, all I need to do is CTRL V anywhere for the word "magic" to be typed out.

Anyone knows how to do this?  Please assist.

Thank you !
0
What is SQL Server and how does it work?
LVL 1
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

i want to create the Batch File to copy one file to another location & can i have complete list of  e.g /e /f /k or how to get this in cmd?

Thx..
0
We have a computer who is accessible by placing   '\\pc-name\j$'  in the Windows Explorer.  We also have that same location mapped using the command 'net use j: \\pc-name\j$'.

When in the command prompt we use   'Dir \\pc-name\j$'   or   'Dir J:\'   works excellently - total access.

However, if place   'J:\'   in the Windows Explorer or if we type   'start.', in order to open explorer at that point, it gives the following error:

WindowsExplorerLocationError



How can we successfully use Windows Explorer to access this   'J:\' ?
0
We have a folder called "Students" that contain student home directories.  Each year we empty them out.  I have the following file below that deletes files/folders within the users folder.  For example, we have 3 folders...

1john.doe
2jane.doe
3david.smith

So the batch file will go into the users folder and delete the contents within, but will not delete the home folder itself.  The problem is, there are some folders that do not begin with numbers and I don't want to delete the content within those folders.  How can I modify my batch file so that it will ignore folders that do not begin with numbers?

@echo off
setlocal EnableDelayedExpansion
set BaseDir=D:\Students\Users
for /D %%A in ("%BaseDir%\*") do (
  set PurgeDir=%%~fA
  del /Q /F "!PurgeDir!\*.*"
  for /D %%B in ("!PurgeDir!\*") do rmdir /Q /S "%%~fB"
)

Open in new window

1
i need to search for particular word "error" in log file that was created for last one hour (or) last hundred files.
0
Here is a solution to this problem - dated 2010.

https://www.experts-exchange.com/questions/25015022/Execute-Dos-app-from-delphi.html

I tried the functions ExecProcess and ExecWaitProcess - but they seem to no longer work under Delphi XE8

Here is my code:

var
  s1: string;
begin
  Screen.Cursor := crHourGlass;
  s1 := 'dir c:\*.* ';
//  ExecProcess(s1, True);
  ExecWaitProcess(s1, True);

  Memo1.Lines.Add(s1);
  Screen.Cursor := crDefault;
end;

Open in new window


Either they fail, or they complete instantly. Any better solutions?
0
Hi,

We have large no of  tif images from which we need to access the properties like size,image resolution, compression etc.
We are able to retrieve file modified date, file size etc but not the above information.
Please suggest an option.

Thanks!
Cph
0
I am trying to get the following DOS command to produce Unicode file names in its output:

CHCP 850 - Multilingual (Latin I)
DIR C:\*.* /b/s > c:\temp\filex.txt

filex.txt does not contain Unicode
0
Date Stamp Issue - I want to copy files from my GoPro to Seagate External - Don't Want Todays Date Want Creation Date.

In the past I've always been able to copy files and the date stamp would be retained to when I created it.  Now all of a sudden every file copied has todays date.  I don't get it.  Why would i want today's date of my videos or photos.

Any help would be great.

I have Windows 10 and I don't want to install additional software, just want to use Windows commands.

Thank you.
0
Hi,

I have a textfile (tab separated), I want duplicate KeyNR to be joined according to the last field.

So I have:

FirstNM        LastNM        KeyNR        Group        Location
John              Doe1            6576            Testgrp      1
John              Doe2            6543            Testgrp      3
John              Doe4            3243            Testgrp      3
John              Doe1            6576            Testgrp      3,4
John              Doe2            6543            Testgrp      2

I want this to result in:

FirstNM        LastNM        KeyNR        Group        Location
John              Doe4            3243            Testgrp      3
John              Doe1            6576            Testgrp      3,4,1
John              Doe2            6543            Testgrp      2,3

As you can see the second and the fifth line and the first and the fourth have the same key, the location needs to be merged with a comma in between.
0
NFR key for Veeam Backup for Microsoft Office 365
LVL 1
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

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



thanks
0
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)
: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?
0
HI,
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
SUB FOLDER :TASK/A/MULTIPLE FOLDERS/ (SPACE)HOLL AND.TIF - ORIGINAL
SUB FOLDER :TASK/A/MULTIPLE FOLDERS/ (NO SPACE)HOLL AND.TIF - RESULT

Thanks!
Cheiro
0
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\TRD_Cost_%dstamp2%.PSV.zip  %exepath%\..\HostTran\Export\Dunnhumby\TRD_Cost*.PSV >> %log%
rem move %exepath%\..\HostTran\Export\Dunnhumby\TRD_Cost_%dstamp2%.PSV.zip   %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

0
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
0
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!
0
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.
0
Hi,

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:

C:\PROGRA~1\AVASTS~1\avast\

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)
0
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?

Thanks
0
[Webinar] Lessons on Recovering from Petya
LVL 10
[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

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
setlocal

:: *** 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

:process
set USER=%Userp%

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

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

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

:leave[/b]

Open in new window


Can u help me?
0
what is the command to copy and entire drive with permissions to another server?
0
How can I run a batch file from within a Word macro?
0
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.. ?
Regards,
0
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
0
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 ?
Regards

PD working with win10, toshiba laptop core i5
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.