Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

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 received an excellent response to my question of deleting files based on match and amount of days old.   Initially I was told they should delete based on age of file and if they have a matching .xxx file.    That has since changed to:   files should delete based on if there is a matching .xxx file and only if it is older than 3 days (regardless if the other files are older).  

The script help I received before from Bill Prew looks like:

@echo off
setlocal EnableDelayedExpansion

rem Define folder to process
set "BaseDir=C:\Users\ad9f2p\TEST CLEANUP"

rem Look at each .XXX file
for %%A IN ("%BaseDir%\*.xxx") do (

  rem Reset delete flag, and check all files with this same base filename
  set DeleteFlag=Y
  for %%B IN ("%BaseDir%\%%~nA.*") do (

    rem Get dyas since last modified (using VBS helper routine)
    set Fileage=0
    for /f "tokens=*" %%C in ('cscript //nologo fileage.vbs "%%~B"') do (
      set Fileage=%%C
    )

    rem If any file found less than 3 days old, do not delete the group
    if !FileAge! LEQ 3 (
      set DeleteFlag=N
    )
  )

  rem If all files found older than 3 days, delete them all
  if "!DeleteFlag!" EQU "Y" (
    ECHO del /q "%BaseDir%\%%~nA.*"
  )
)

Open in new window

Can I add a nested If statement to the section:

    rem If any file found less than 3 days old, do not delete the group
    if !FileAge! LEQ 3 (
      set DeleteFlag=N
    )

Open in new window

Can I check the file age on only the .xxx files and delete the corresponding files that match then, only if the .xxx file is older than 3 days?   I've tried doing this by rearranging the logic, currently it deletes everything with a .xxx file:    What am I missing here?


Open in new window

0
Visualize your virtual and backup environments
LVL 1
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

I'm trying to stream content using Livestreamer from YouTube to VLC. However, the streaming starts but the video is frozen. I notice no audio is present as well. Any ideas what It could be? I tried the smallest resolution 144p and I get the same results as if I try at 1080p.
0
Rename this sort of multiple file names
"20171014_user_id_17875988194160002_1507954651_replay.mp4"
to
"String1 user_id String2.mp4"

String user_id is dynamic in nature and not fixed and not known in advance
0
Hello. The question I am asking is for educational purposes only. I'm using a computer that has blocked permissions by the Administrator to not allow anyone from using Command Prompt or PowerShell.

Even though its blocked, is there still a way to access the Command Prompt or PowerShell? A 3rd party command prompt will work? This is not for malicious purposes, educational purposes only.
0
device driver not found BANANA
NO VALID CDROM device drivers selected

I had downloaded the ms dos 6.22 iso file and copy it into floppy by winimage but when I try to install ms dos it shows this error and in my system I don't have cdrom or dvdrom , I only have floppy drive with 500 mb hard disk.
0
Dear Experts,
We need codes for batch file to check a particular file is modify time is within last 30 Min.
If file is modified in last 30 Min then execute another batch file

Else end the script.

Requesting to help in the same.

Regards,
Girish T.
0
I will have several files during the day. Cannot select the latest with timestamp, i need to have to file with the greatest id.

The file name is in a format: [standardname]_[date]_[id].csv. Eg invoices_2017_09_19_186.csv
0
I need help. How to create batch file to import value from text file and write it to registery during osd.
I want to add key  in hkl\software\syswow64\me\  the value would be jack,  help would be appreciated.
thanks
0
Looking to use a dir command in the prompt that will write a txt file that includes the below info for ALL files:

File Name/ File Path / Last Modified Date/ Creation Date / Modified By

This should go through the entire subfolder structure of the directory.
0
Hi, We have a requirement as below

We  need a solution to extract the count of pages in a multipage TIFF file, which are available in Sub folders.

Thanks!
CPH
0
Free learning courses: Active Directory Deep Dive
LVL 1
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

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
I'm writing a batch file that needs to read In a text file with multiple lines (2-3 or more) and assign them to variables (i.e. Line1, Line2, Line3).  which will then act on those to run jobs based on the variables read in.  What is the easiest way to do this preferably without for loops or delims. etc.

Thx,
Brian
0
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
Get free NFR key for Veeam Availability Suite 9.5
LVL 1
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

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
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 need to install a usb boot disk to run a bat file to install winodows updates and Surface Tablet firmware updates
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

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.