Microsoft DOS

13K

Solutions

8

Articles & Videos

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 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
Free Tool: IP Lookup
LVL 8
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

I don't have xcopy for Windows 2000.

I want to write a super simple DOS bat file to do this daily:
1) Copy all files in C:/SourceDirectory and in C:/SourceDirectory2 to D:/DestinationDirectory that are created or modified after and including June 1, 2017.
2) Create a copy of  D:/DestinationDirectory and rename it as DestinationDirectory_MMDDYY where MMDDYY is the current month, day and year.

How do I do this?
0
I use Ola Hallengren's maintenance for all of my customer's, https://ola.hallengren.com/sql-server-backup.html.
Have used it for years, never any real problems -- until now.  For some reason the @CleanupMode and @CleanupTime are not working. The backup step is configured to retain bak files for only 24hrs, and to cleanup the old bak before generating the new.  For some reason, it is not working, and the job keeps failing due to insufficient disk space.

My temporary workaround is below.  I am deleting the largest bak file from disk as a first step in the job, until I get Ola's logic corrected.  Well, it works great as-is, but I've found I need to run it for all subdirectories.

The way it works now is to del the bak file in this path explicitly:
SET @path = 'dir \\backups\servername\dbname\FULL\'

I need it to delete the bak files from all subdirectories within \\backups\servername\

Any help?



SET NOCOUNT ON;

IF OBJECT_ID('tempdb..#files') IS NOT NULL
DROP TABLE #files;
CREATE TABLE #files (Line VARCHAR(512)) 
DECLARE @path VARCHAR(49) 
DECLARE @cmd1 VARCHAR(155)
DECLARE @cmd2 VARCHAR(155)
DECLARE @filename VARCHAR(255)
SET @path = 'dir \\backups\servername\dbname\FULL\'
SET @cmd1 =  @Path+' /A-D  /B' 
--PRINT @cmd1

INSERT #files
EXEC master..xp_cmdshell @cmd1
DELETE #files WHERE Line IS NULL
--SELECT * FROM #files

SET @filename = (SELECT Line FROM #files)
SET @cmd2 = 'del \\backups\servername\dbname\FULL\' + @FileName
--PRINT @cmd2

IF EXISTS(SELECT

Open in new window

0
Hi Experts,

I am trying to figure out why when I create a new ADP and set the connections properties to my server (SQL 2008) then it goes fine, however if I take my old ADP and try to modify the connection to use the new server I get the attached error.

BTW, I had someone looking into this today and he was using netstat - na find "XXXX" to see where is that trying to connect to, wondering how do I use that command?

Thanks in advance.
Untitled.png
0
is there a DOS command to run to get list of all NT group that contain a certain word like 'sql', 'Reporting' etc.
thanks.
0
Amazon Music, for reasons only know to them, downloads the following file

          Mason Williams - Change the World.MP3

renaming the files during download as follows:

          01-02- Change the World.MP3

I know restoring the artist's name is going to be difficult, but how do I batch rename...

          01-02- Change the World.MP3     to     Change the World.MP3
          01-04- Hello, Goodbye.MP3          to     Hello, Goodbye.MP3
          02-02- Ticket to Ride.MP3             to      Ticket to Ride.MP3

In other words, stripping the 0?-0?-   from the front-end of the filename.

I have tried several iterations of REN such as REN  "0?-0?-*.MP3"  "*.MP3",  but nothing I do seems to work. Suggestions?
0
Thanks to the way Amazon Music downloads MP3s, I have 704 files in 592 directories. I want to copy all of the files into a single directory. I tried a utility called XXCOPY. All the files copied to one directory but in doing so all of the filenames were modified to contain the directory structure. Poor solution. Anyone have another idea?
0
when it displays "Global Group memberships", it it is long, then it is only partially seen. is there a way you break it down to many single line step output?
0
Please give me one help
Error:
   How to send email by blat as per script below?

@echo off
setlocal EnableDelayedExpansion

rem Set destination folders for each weekday, Sunday = 1
set Dest[1]=BKP1-DOM
set Dest[2]=BKP2-SEG
set Dest[3]=BKP3-TER
set Dest[4]=BKP4-QUA
set Dest[5]=BKP5-QUI
set Dest[6]=BKP6-SEX
set Dest[7]=BKP7-SAB

REM Get day of week number, Sunday = 1
for /f "skip=2 tokens=2 delims=," %%a in ('WMIC Path Win32_LocalTime Get DayOfWeek /Format:csv') do set /a DowNum=%%a + 1

rem Set todays destination folder
set DestDir=!Dest[%DowNum%]!

rem Copy todays files to their destination folder
set HadErrors=N
    
    XCOPY C:\BNET_CIT\ATI\*.*                       C:\BNET_BACKUP\%DestDir%\ATI\   /S /Y  || (set HadErrors=Y)
    XCOPY C:\BNET_CIT\CIA\*.*                       C:\BNET_BACKUP\%DestDir%\CIA\   /S /Y  || (set HadErrors=Y)

rem Check for any errors during copies and send email
if "%HadErrors%" EQU "Y" (
  rem Send email indicating failure here

  REM * Uses blat.exe and body.txt as body of message:
     set dir=C:\BNET_BACKUP\1_Blat_SendMail_v3217\full
     set hostname=servername
     set subject="* O Backup Falhou. Verifique o erro e tome as devidas providencias."
     set toaddress=xxx@xxx.com.br
     set receipt=NO

) else (
  rem Send email indicating success here

  REM * Uses blat.exe and body.txt as body of message:
     set dir=C:\BNET_BACKUP\1_Blat_SendMail_v3217\full
     set hostname=servername
     set subject="* O Backup foi executado 

Open in new window

0
We have an old accounting program that wants to write to a dot matrix printer and was setup to use LPT1 via a command:

net user lpt1 \\computer\printer

I want the output to go to a pdf how is this possible? Alternatively to a file
0
Enroll in June's Course of the Month
LVL 8
Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Suppose  file a.bat is calling b.bat.  If there is any error in running any command line in b.bat, is it possible for this error be caught in bat.b

In file a.bat, the following lines have been added but it doesn't help.

   IF '%ERRORLEVEL%'=='0' (
       echo Success! >> C:\Scripts\%yyyymmdd%\Patch.log
   ) else (
       echo Fail ! >> C:\Scripts\%yyyymmdd%\Patch.log
   )
0
Hi

I need to run a windows task scheduler job using a specific domain user account.  What user rights does it require ?

Thanks
0
I know the DOS command to copy a file from one folder to another in the Windows file system.  But what I need to do is have that copy process executed automatically as soon as a file is dropped into the first folder.  How can that be done?
0
I need to set a variable based on two conditions.  If either of the conditions are true then set the variable one way, if neither are true then set the variable another way.

Basically I'm playing with changing the 'theday' and the 'DATE_dow' variables and running.  However it's not working.  The logic is:

If %theday% LEQ 12 OR %DATE_dow% then excludeDirsDistr=Distr,Distrstg,DistrDEC,
else if neither of those are true then excludeDirsDistr=

I'm obviously not nesting this correctly or the logic above I can't accomplish like this.  Played with all kinds of combinations and not working.  Trying to avoid many 'IF' lines in order if possible...

set theday=11
set DATE_dow=Thu
set excludeDirsDistr=Distr,Distrstg,DistrDEC,
if not %theday% LEQ 12 if not %DATE_dow%==Wed set excludeDirsDistr=

Open in new window

0
Hello,

I have a script that I am using to delete old files off of the system by modified date.  Is there a wild card that can be used in the folder path?

for /d %%D in ("C:\test\test\*.*\files") do forfiles /p %%D -s -m *.txt -d -5 -c "cmd /C del @File"

Open in new window

If I run this on a specific directory it works fine.  I need it to run for all files directories under that path. I tried * and *.* but it did not work.

Thank you
0
Hi,
amongst all the daily activities I have, there 2 that really takes a lot of time because I have to do it manually :(

Case 1:
I have 1 executable file, "myApp.exe" that needs to be copied  (and overwrite existing one) to a second server:
from \\SERVER1\anyFolder\myApp.exe to \\SERVER2\anyFolder\myApp.exe
Issue:
I am trying to do it automatically via CMD script using "runas" command but it is not working transparently because it ask me for password, eache time It connects to a different server (14th servers).

"run.bat" file runs:
runas /netonly /user:AMERICAS\myUserName RemoteServer01.bat

"RemoteServer01.bat" file runs:
Copy \\RemoteServer01.americas.local\e$\Tools\RMTool\RMTool.exe \\RemoteServer02.americas.local\e$\Tools\RMTool\RMTool.exe  /B /Z /Y

Open in new window


Case 2:
This one is done via RDP but I would like to do it via cmd if possible:
First step, connect to \\SERVER1\d$\ProductFolder
Second step, using Windows  "Right click / Compress to zipped folder" compress to zip "ProductFolder"
Third, rename resulting zip file adding (manually) current date as a prefix, example of resulting file: "2017-05-05-Oracle.zip"
Fourth step, Move the resulting zip file to \\SERVER1\e$\Backup folder

Thanks a lot!
0
When the windows schedule task is executed it may end with an error code i.e. the "Last Result" may report a error result status other than 0, which would mean that the schedule task has failed, as it has not completed successfully with a result status code of 0

If I run the command:-

schtasks.exe /query /fo list /v /TN Burst_Triggerbatch | find "Last Result" this will produce something like the following:-

Last Result:                             -2147024895

So, ideally what should happen is,  this script will run overnight and check the status of the Last Result section and return the value to a output txt file if the value does not equal to 0.  This will indicate that the windows schedule task failed because the "Last Result" status was not 0

Is this achievable, or suggest any ideas ?

Thanks
0
Hey Experts.  I have two directories (A and B).  Almost all of the 200 files that are in A and B are the same except for maybe 10 or 20.  The 10 or 20 files have a different size and modified date.  I just want to run a script that compares the two directories and if file a in dir A and B differ, it's logged.  This is unfortunately outside my feeble abilities but I'm sure there is a scripting master that can do it (in batch, preferred).

Thank you in advance!
0
Hi Guys, I used text-to-columns to convert a text file to Excel. I have added some info into the Excel file and I now want to convert it back to an MS Dos file with "~" in between the lines. How do I do this?
Transaction_Details_20170428.xlsx
0
[Webinar] How Hackers Steal Your Credentials
LVL 8
[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Hi Experts,

I'm looking to see which files were placed today (or last few days) on a network drive, since they can be in different folders/sub folders, how can I get such a list?

PS. If I can see which user created them that would be great..
0
Hello. Can someone tell me how to get the MYSQL command line stuff to work in DOS?  I installed WAMP on my windows 8.1 computer.  By installing that I also installed MYSQL 5.7.14.   So I go to this directory C:\wamp64\bin\mysql\mysql5.7.14\bin and start mysql by using the command mysql -uroot -p.  I'm able to log in just fine but when I do something as simple as importing a new database I get errors.  For example, after a brand new install of WAMP and mysql I tried to import one of my MYSQL databases using this command:

mysql -uroot  -p mydatabase < c:\mydatabase.sql;

When I press enter I get this error:
EEEOR 1064 (42000): You have an error in your SQL syntax; check the namual that corresponds to your MySQL server version for the right syntax to use near 'mysql -uroot -p mydatabase < c:\mydatabase.sql'

I get the same error even if I do a simple command like mysql -v;

But other commands work like show databases;

Can anyone tell me what I need to do in order to get this to work?
0
Hi All,

I had a windiws 95 hard drive fail last week due to bad sectors.  I was able to recover the data, but the new disk won't boot.  I've got a start up floppy disk which let's me get me to a command prompt.  When I try to run window it says incorrect version of dos.  I guess it's using the version on the floppy disk.

Any idea how I can update it?

Thanks
D
0
I have .ods files in branch wise folder, in branch folder there is Subfolder named Data in data folder there  are date wise folders in which file is exist.
i want to copy that file with .ods extension from current date folder to one single folder. e.g. i have 120 branches so i need to get each file from current date folder in One single folder.

example of files available subfoders:
C:\Users\Bandra\DATA\19\04\2017\Bandra.ods
C:\Users\Santacruz\DATA\19\04\2017\Santacruz.ods
C:\Users\Sion\DATA\19\04\2017\Sion.ods
0
How to make a "Try / exception" from the code below?

1) "running successfully", send an email.
To: xxx@hotmail.com
Subject: Backup completed successfully.
Body: Backup performed successfully.

2) In the exception, "not executed", send an email.
To: xxx@hotmail.com
Subject: Backup failed.
Body: Backup not performed.


---Code

@echo off
setlocal

REM Get day of week number, Sunday = 1
for /f "skip=2 tokens=2 delims=," %%a in ('WMIC Path Win32_LocalTime Get DayOfWeek /Format:csv') do set /a DowNum=%%a + 1

REM Call subroutine for this days logic
call :Day%DowNum%

REM Exit this script
exit /b

:Day1
  REM Add logic for day here (Sunday)
  echo Day=1
       XCOPY C:\BNET_CIT\ATI\*.*                                                     C:\BNET_BACKUP\BKP1-DOM\ATI\ /S /Y
       XCOPY C:\BNET_CIT\DADOS\SIS\DB_BNET_CITSIS.mdf      C:\BNET_BACKUP\BKP1-DOM\DADOS\SIS\ /S /Y
       XCOPY C:\BNET_CIT\DADOS\SIS\DB_BNET_CITSIS_log.ldf  C:\BNET_BACKUP\BKP1-DOM\DADOS\SIS\ /S /Y
  exit /b

:Day2
  REM Add logic for day here (Monday)
  echo Day=2
       XCOPY C:\BNET_CIT\ATI\*.*                                                     C:\BNET_BACKUP\BKP2-SEG\ATI\ /S /Y
       XCOPY C:\BNET_CIT\DADOS\SIS\DB_BNET_CITSIS.mdf      C:\BNET_BACKUP\BKP2-SEG\DADOS\SIS\ /S /Y
       XCOPY C:\BNET_CIT\DADOS\SIS\DB_BNET_CITSIS_log.ldf  C:\BNET_BACKUP\BKP2-SEG\DADOS\SIS\ /S /Y
  exit /b

:Day3
  REM Add logic for day here (Tuesday)
  echo Day=3
       XCOPY C:\BNET_CIT\ATI\*.*             

Open in new window

0
Hi

I have the following powershell script which is called within a DOS batch:-

@ECHO ON
PowerShell.exe -NoProfile -Command "& {Start-Process PowerShell.exe -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""%~dpn0.ps1""' -Verb RunAs}"

I need to include error conditions in the script, if the script fails and logs these entries to a log file or eventviewer please ?

Thanks
0

Microsoft DOS

13K

Solutions

8

Articles & Videos

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.