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 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
How do I pass unicode filenames as parameters via Command Prompt or any other method ?
I have an Exe which I have to call via Command Prompt/ power shell
Applicable to all current OS of windows.


I am using Windows7.

regards

Allan
0
I do much work with my legacy software in DOS windows of Windows 7 32-bit, sometimes with 3 DOS windows open at one time.
 It's time for another computer, but most PCs are sold with 64-bit Windows 10 installed.  My research so far suggest that using DOS on a 64-bit system with things like VDOS or DosBox is very cludgy.  Would appreciate learning any better way to recreate my DOS-friendly environment in a 64-bit OS.  If not I will have dealer install 32-bit Windows 10.
0
I can't figure out how to make a lives system for my game and I need to know how.

Here is my code for the lives;

SET lives=5

:Scene1
CLS
ECHO  o       Woof!
ECHO /0\   ,###@'
ECHO / \     /   \
ECHO #########################################
ECHO.
ECHO You are walking along the dirt
ECHO road with your backpack and trusty dog Steve.
ECHO You have !lives! lives.
PAUSE
CLS

. . .

:WinFight1

SET /a lives-=1
CLS

ECHO  o
ECHO /0\    ,###@                      w   \__,.  \__,.
ECHO / \      /   \                        3--`~  /--,^  /--,^
ECHO #########################################
ECHO.
ECHO You won the fight!
ECHO You now have !lives! lives.
PAUSE
GOTO Scene2

Open in new window



I expected it to output 'You have 5 lives.' in the first section, and 'You now have 4 lives.' in the second part, but instead, I got 'You have !lives! lives and 'You now have !live! lives.'
0
I want to get a listing of all files under a directory  along with the full path ( or relative path)
I want the list of all files including the subdirectories  ( This is Windows server 2012)
There are about 3 million files altogether
 I want the whole list ( File names with extension  and paths )  in an excel sheet or MS Access DB

Can you please help?
1
Hello,
I would like to use a script to query the processes on the server, based on the process id and returns the user name. I tried following four methods and they all only work with administrator permission.  Without admin permission, they will not return the user name. May I ask if any method to return the user name, without server admin permission? Thanks so much in advance!

get-process -id 12856 | select-object id,name,@{n='Owner';e={$owner}}

Get-Process -Id 12856 -IncludeUserName | Select-Object -Property UserName

tasklist.exe /v /fi "PID eq 12856"

QUERY PROCESS 12856
1
I have a batch script that I am attempting to use from a WinPE boot disk to capture and restore hard drives.

Here is the snippet of code I have that is failing.

echo Please locate image name from list below
echo ==========================================
echo Here are the images we found on your drive
echo ==========================================
echo ==========================================
@echo off
for %%p 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 %%p:\images set w=%%p:\
dir /b /w %w%images
echo ==========================================
echo ==========================================
echo Press enter when you are ready
pause


:imageName
@ECHO OFF
SET /P imageName=Please system image name for deployment: 
IF "%imageName%"=="" GOTO imageNameError else goto deploy

:deploy
@echo off
for %%p 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 %%p:\images set w=%%p:\
DISM /apply-ffu /ImageFile=%w%images\%imageName%.ffu /ApplyDrive:\\.\PhysicalDrive0

Open in new window


If I however go to the path containing the ffu image and run this snippet of code, manually, it works.

Anyone else using DISM and encountered this?

DISM /apply-ffu /ImageFile=d:\images\windows.ffu /ApplyDrive:\\.\PhysicalDrive0

Open in new window

0
Is there a way to run this automatically?  We have users who get "There are currently no power options available" and I was able to get power options by running it 2 machines so I think it'll work on many more here.

start, run  cmd with administrative rights

secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose

and upon restart, they'll have power options.
0

One for the Experts...


31


Good day gentlemen (and any ladies that may also be present among us).

I have a cracking challenge that will tease your expertise.

I have titled this challenge '31' because it is based on a simple game I played as a child.

The game starts with a running total of 0. Two players take turns choosing a number between '1' and '6' which is added to the total. The player who chooses the number which brings the total to '31' wins.

The numbers '1' to '6' are chosen from a pool of four '1's, four '2's, four '3's, four '4's, four '5's and four '6's. Once a number is chosen, it is removed from the pool of available numbers.


Example:

Total = 0

Let's say we have the following numbers available:

1111
2222
3333
4444
5555
6666

Player A chooses say, 5.

Total = 5 (because 0 + 5 = 5)

A '5' is removed from the pool of available numbers so we now have:

1111
2222
3333
4444
555
6666

(Notice there are now only 3 '5's in the pool)

Let's say player B chooses '4'

Total = 9 (because 5 + 4 = 9)

And our number pool now looks like the following:

1111
2222
3333
444
555
6666

If any set of numbers '1' through '6' is exhausted then that number cannot be chosen in subsequent turns.


Programming Considerations

The program must be written using only DOS commands as a .BAT or .CMD
0
We need to create a series of files with over 1gb size for a project we  have.  We use fsutil and it works; the problem is that it affect the "free space" when querying the disk size.  Is there a waye to do this?
0
I recently updated a sync computer batch file from xcopy to robocopy.  This resolved some problems but I discovered that robocopy does not copy open files as xcopy did. Does anybody know of a copy routine that can run from a batch file that copies open files. The biggest problem is MS Word keeps files open in the background even after it is closed. It would be great if it has a copy version option (copy newer files to a new version number instead of overwriting the older file) and multi-thread capability. Free or low cost would also be good.

TIA
0
Hi Experts,
pls help me out on this. bit tricky one :)

1. Have a file similar to ".ini" format header and its sections. e.g. schema.ddl
2. Another file with list of keywords on each line. e.g table_list.txt
3. Need to read each line from table_list.txt and search it in schema.ddl and remove the entire table section and its associated index section as well.

Have attached both the files for your quick reference. pls unzip schema.zip file.

E.g
"S_PARTY" is the first keyword from the table_list.txt
table section can be found in schema.ddl between line # 317941 and 317960
associated section can be found between 317962 and 318029

basically for each keyword (table name) we need to repeat the process and remove relative entries using windows batch or powershell or vbscript reason,  this will be executed on a windows machine. if any util that doesnt require installation and would easy this. we can use that util as well.

pls help and thx in advance.
schema_txt.zip
table_list.txt
0
I currently have three folders on my "H" drive
  ** H:\a\.........
  ** H:\b\.........
  ** H:\c\.........

I then do robocopy G:\ H:\ /s /e /copyall /mir /v /tee /r:0 /log:robocopyNOTES.txt and all of the above folders get deleted, even when I do NOT have these folders on the G drive

How can I copy the G drive folders to the H drive, keeping existing H drive folders as-is if they do not have the same name as G drive folders ?
0
Hi Experts,
I would like to have a script/function that opens the following site
https://pages.caspio.com/login/bridgelogin/default.aspx?_ga=2.157757818.1116850724.1518037460-1462101065.1512014265
fills in the account, username and password.
See attached.
Should either be done thru Access VBA or via script.
Thanks in advance.
Untitled.png
0
Need solution in UNIX for below scenario.

I have a folder like /desktop/user/folder with the below files in it. I want the count of the files after removing the timestamp from the files.
Need more of a generic solution which can handle any timestamp format and file format.

test_file1_20110101.txt
test_file1_20109102.txt
test_file2_20110102.dat
test_file2_20110103.dat
test_file2_20110104.dat

Expected Result:
test_file1    2
test_file2    3
0
Hello Experts,
We have windows 7-64 bit systems in my office network with administrator user login, i need a batch file to install IP in systems (physically access) from a iplist.txt after install IP it should block IP change permission & protect with password.
0
i have an old HP 6360 computer and an HP 5 printer that i use for printing financial statements and envelopes. i am still using lotus's symphony in dos for the f/s and office 97 for the envelopes. my os win 98 became corrupted and i had to start over with another hard drive. i was able to install the old drive as a slave and obtain the files and software copied to the new hard drive. the system is up and running and i can print envelopes in windows w/ the office 97 from the templates that i retrieved. symphony files and f/s runs fine and i can retrieve all files but i can't print the files on  the HP 5 printer. the "printer driver not loaded" error. i have the original 3 1/2 diskettes that came with the printer and have attempted to load the drivers numerous times and followed the directions as best i can and have 2 large manuals for symphony that i have had since 1984. this is a complicated program for an accountant but not a programmer i guess. i don't how the drivers are loaded to the program in dos and how it works. the printer drivers are supposed to go to a file called "lotus" . i don't know whether the program has to be on the root directory along with the "lotus" file and loaded when dos boots etc. i don't understand how it works and at my memory is not 100% from something that was done that long ago. this machine is a stand alone as is not hooked to the internet. basic office tasks only but it still has a function. thanks.
0
Hi, I did some WMI troubleshooting on a Win10 Pro that was having trouble with the SCCM client installation.
After running the WMIDiag.vbs script from the WMI Diagnosis Utility 2.2 DL link (https://www.microsoft.com/en-us/download/details.aspx?id=7684), I ran this on an elevated command prompt:

dir /b *.mof *.mfl | findstr /v /i uninstall > moflist.txt & for /F %s in (moflist.txt) do mofcomp %s

I didn't notice that I was currently in the C:\Windows\System32 directory instead of a level deeper, in wbem. My bad.
I got the following output:

===========================================================================
C:\Windows\System32>dir /b *.mof *.mfl | findstr /v /i uninstall > moflist.txt & for /F %s in (moflist.txt) do mofcomp %s

C:\Windows\System32>mofcomp psmodulediscoveryprovider.mof
Microsoft (R) MOF Compiler Version 10.0.10240.16384
Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
Parsing MOF file: psmodulediscoveryprovider.mof
MOF file has been successfully parsed
Storing data in the repository...
Done!

C:\Windows\System32>mofcomp RestartManager.mof
Microsoft (R) MOF Compiler Version 10.0.10240.16384
Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
Parsing MOF file: RestartManager.mof
MOF file has been successfully parsed
Storing data in the repository...
WARNING: File RestartManager.mof does not contain #PRAGMA AUTORECOVER.
If the WMI repository is rebuilt in the future, the contents of this MOF file will not …
0
I have the following batch file.

@echo off

set hour=%time:~0,2%
if "%hour:~0,1%" == " " set hour=0%hour:~1,1%
echo hour=%hour%
set min=%time:~3,2%
if "%min:~0,1%" == " " set min=0%min:~1,1%
echo min=%min%
set secs=%time:~6,2%
if "%secs:~0,1%" == " " set secs=0%secs:~1,1%
echo secs=%secs%

set year=%date:~-4%
echo year=%year%
set month=%date:~4,-8%
if "%month:~0,1%" == " " set month=0%month:~1,1%
echo month=%month%
set day=%date:~7,-5%
if "%day:~0,1%" == " " set day=0%day:~1,1%
echo day=%day%

set datef=%hour%-%day%-%month%-%year%
set dayf=%day%-%month%-%year%

echo datetimef=%datef%
echo %dayf%

pause

set findtext=" DS-"
set findfile="Z:\OP\exa\02-04-18 - Copy.P02"

findstr %findtext% %findfile%

for /f "delims=" %%a in ('findstr %findtext% %findfile%') do echo %%a >> "Z:\OP\test-%month%-%year%.txt

pause

Open in new window

I however need to search for multiple criteria i need to find all instances of " DS-" and " DSA-" how do i search for both?
0
Hello, Everyone, I found two very similar one-liners as part of the solution to WMI issues in SCCM client installation:

1.) from https://www.virtuallyboring.com/microsoft-wmi-invalid-class-error-0x80041010/
dir /b *.mof *.mfl | findstr /v /i uninstall > moflist.txt & for /F %s in (moflist.txt) do mofcomp %s

2.) from https://blogs.technet.microsoft.com/yongrhee/2016/06/23/wmi-stop-hurting-yourself-by-using-for-f-s-in-dir-s-b-mof-mfl-do-mofcomp-s/
dir /b *.mof *.mfl | findstr /v /i uninstall > moflist.txt & for /F %%s in (moflist.txt) do mofcomp %%s

What's the difference between the two? I used the line from link #2 (%%s), but I got the error "%%s was unexpected at this time."   I understand from other posts that using "%%s" in batch files will not yield errors.  When I used the line from link #1 (%s), the command ran.

If both lines get executed successfully, whether via CMD or BAT files, would they have the same end result?

Thank you very much.
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
>