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

DOS command for making files visible in a folder

I seem ed to have made all fiels in a folder invisible / hidden

I may have used this command
whatever directory>attrib -s -h -r /s /d *. *

How to undo this?
0
creating a batch file to delete all empty directories on the i drive - using after pkzip zips all files

Found this on the internet

i:
cd /
for /f "delims=" %%f in ('dir /ad /b i:\') do rd /s /q "i:\%%f"

but it deletes directories and files
0
I wish to scan a massive folder structure to see which folders a person had access to during his employment, i.e. the ones where he was given specific access to instead of a group he was a member of.

I found one called accesschk that I can run from a command prompt, but it doesn't seem to drill into the folders.  Has anyone seen a program which will do that and just spot out a text or csv file I can sort?
0
We have a custom dos program that talks to you logging handheld we currently switched it to a new system. we got a lot of issues fixed but get the errors show in attached pictures when trying to edit  load.
59728213127__565636C0-9E33-438E-BC28.jpg
59728214590__E365464D-519C-4B7B-97D4.jpg
IMG_3727.jpg
0
Hello Team
I like to have a batch  cmd file or powershell script to  copy folders (documents,downloads,desktop,favorites) from user that has old computer  with old computer name to user  that will have new computer  with another computer name  both computers have different computer names and connected to same network as I would like to run this  script on  new computer of user so  it has to ask for computer name so I write old computer name of user and then ask about user folder so I select user profile from c users folder and after it copies documents ,downloads,desktop ,favorites from old computer of user to new computer of the user as i would like to acheive that in powershell and batch cmd  that shows progress bar while copying and log file
0
Please guide me to create a MS Dos script that would send an email via outlook to more than one recipient when a file is updated at certain location on the network.

Thank you,
0
If I run the commands below the first one opens a notepad text file in a maximized notepad window. The second one opens the same file but the notepad window is minimized.
So I am wondering two things.

1. Is there a way to open the notepad window so that it is half or fractionally open? Like 1/2 the normal size.
2. Is there a way to specify the location of the notepad window when it initially opens? Like left of center?
    I ask this because I will open a two notepad windows and do not want them to all be in the same location/coords. I would prefer
    that the last window open is displayed slightly to the right of the first notepad text file displayed.



1. C:\cmd.exe /c start /max notepad.exe c:\mySampleFile.txt

1. C:\cmd.exe /c start /min notepad.exe c:\mySampleFile.txt
1
Hi

I am finding a script to update email signature when a user login our network.

The mechanism is simply copy a pre-created signature in server to their signature folder (%userprofile%\AppData\Roaming\Microsoft\Signatures\)

For example
Copy server\%username%\*.*     %userprofile%\AppData\Roaming\Microsoft\Signatures\  
Copy server\%username%\user1_files     %userprofile%\AppData\Roaming\Microsoft\Signatures\

This is to copy all files by *.* and the folder name "user1_files"

But I cannot find the VBScript. For DOS, it can only copy files. I don’t want to create a folder method because I may use Excel to generate the script if using DOS.

Anyone can help?
0
I have few OS commands which I need to run only through ADMINISTRATOR's CMD console
please advice how to call such batch script

example :TEST.BAT
how to make sure below  script called from admin cmd console
==

echo " Hello"

==
0
I run the following script .cmd file



@echo off
setlocal enabledelayedexpansion

set startTime=%Date% %time%
echo Start Time: %startTime%

Robocopy /s \\Image1\Images\ICSStorage\20080211\C43F9AAF-B3F1-46EC-A2BE-E3B8BED78B7E.tif      \\testsql3\NGProductionDocs\NGSourceDocs\ICSStorage\20080211\C43F9AAF-B3F1-46EC-A2BE-E3B8BED78B7E.tif      /dcopy:t /mir /FFT /Z /np /tee /log+:D:\NGProductionDocs\Config\Log\CopyOverLog\CopyOver_ICSStorage.log
      

echo Finish Time: %Date% %time%
pause

I have the following error

'\\testsql3\Config\Maintenance\NGPRDToTestSQL3'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
Start Time: Sun 01/13/2019  0:07:31.87

 Log File : D:\NGProductionDocs\Config\Log\CopyOverLog\CopyOver_ICSStorage.log

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows

-------------------------------------------------------------------------------

  Started : Sun Jan 13 00:07:31 2019

   Source : \\Image1\Images\ICSStorage\20080211\C43F9AAF-B3F1-46EC-A2BE-E3B8BED7
8B7E.tif\
     Dest : \\testsql3\NGProductionDocs\NGSourceDocs\ICSStorage\20080211\C43F9AA
F-B3F1-46EC-A2BE-E3B8BED78B7E.tif\

    Files : *.*

  Options : *.* /FFT /TEE /S /E /COPY:DAT /DCOPY:T /PURGE /MIR /Z /NP /R:1000000
 /W:30

------------------------------------------------------------------------------

0
What is the command line, within a batch, if possible, to start that batch in Administrator mode?
Or would another batch be needed to trigger this batch in Administrator?
0
Hi

I am using below dos command to upload excel reports on to SharePoint. It is working fine. Only issue is, if someone opens the current file from SharePoint, below code is unable to upload updated file onto SharePoint, because the same file has been checked out to someone.  How can I solve this issue? I want a dos command which can  kill the same file (which are there on the code) from SharePoint before upload the fresh one.

@echo off
setlocal

echo Start Copy

set SOURCE_DIR=C:\abcd\efg\hij
set DEST_DIRS="Y:\"
set FILENAMES_TO_COPY="abcd.xlsx","xyz.xlsx"

pushd "%SOURCE_DIR%"

for %%F in (%FILENAMES_TO_COPY%) do (

    for %%D in (%DEST_DIRS%) do (
        echo file "%%~F" to "%%~D"
        xcopy /Y "%%~F" "%%~D"
    )

)

popd

echo. Done.
exit /b

Really appreciate help on this

Thank you
0
Hi,

I am looking for a script which loads files to SharePoint daily basis. I use windows 10 and 7 laptops. I have created mapped drive to SharePoint on my computers. I was using batch file to migrate data quite successfully. But now I have to migrate data into different folder and links in SharePoint. My batch file(dos commands) is not capable to do that.
0
Hello Experts,

I need a help I've a batch script for folder locking, in this script I've set a password for folder access after that I convert this batch to exe & give it to users.
Now user wants to create own password & after creating the password once user put password for folder access it should not be appear it should be in form in dot or blank.
Most important thing i want set a default password in case users forget password in that case admin should open that folder from default password, also main folder, sub folder & files which is store in Vault folder should not be find if anyone try to find using windows search.

Script:-

cls
@echo off
mode 50, 10
title   ~Safty Vault~

echo.
(SET OUT=3F)

color %OUT%

if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Vault goto MDLOCKER
:CONFIRM
echo Are you sure you want to lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Vault "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter password to unlock folder
set/p "pass=>"
if NOT %pass%== password goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Vault
echo Folder Unlocked successfully
0
Chemo has taken a lot from me. I am having problem with a batch file and have gone back to square 1 to test simple things.

@ECHO OFF
IF EXIST %1 GOTO ITEXIST
ECHO %%1 DID NOT EXIST
GOTO EXIT
:ITEXIST
ECHO %%1 DID EXIST
:EXIT
ECHO ON

Why am I getting a syntax error?
1
Hello Experts,

I am trying to run as administrator a .bat file on a Windows 10 virtual machine remotely via VirtualBox's command line interface. I am controlling the Windows 10 virtual machine via a Linux headless server.

Currently I am using the command:

vboxmanage guestcontrol "win10clean" exec --image "C:/Temp/run.bat" --username localadmin --password *** --verbose --wait-stdout

Output:

Opening guest session as user 'localadmin' ...
Waiting for guest session to start ...
Guest session (ID 13) has been started
Starting guest process ...
Process 'C:/Temp/run.bat' (PID 4592) started

C:\WINDOWS\system32>REG ADD HKLM\Software\Microsoft\Windows\currentversion\explorer\advanced /v Start_PowerButtonAction /t REG_DWORD /d 2 Process terminated
Exit code=1 (Status=500 [successfully terminated])
Closing guest session ...

The VM name is win10clean
The .bat file is called run.bat and is stored on the VM under the path C:/Temp/
The run.bat file is suppose to update a registry value which is why the command must be run as administrator. However the registry value says the same.
1
Hi,

Please let me know how to add SharePoint login credentials in below code.

@echo off
setlocal

echo Start Copy

set SOURCE_DIR=C:\Users\xxxx1\Desktop\kk1
set DEST_DIRS=C:\Users\xxxx1\AppData\Roaming\Microsoft\Windows\Network Shortcuts\SharePoint
set FILENAMES_TO_COPY="Report.xlsx", "Report Full.xlsx"

pushd "%SOURCE_DIR%"

for %%F in (%FILENAMES_TO_COPY%) do (

    for %%D in (%DEST_DIRS%) do (
        echo file "%%~F" to "%%~D"
        xcopy /Y "%%~F" "%%~D"
    )

)

popd

echo. Done.
exit /b

Really appreciate any suggestions on this.
K
0
Hi

I have some reports (MS excel Spreadsheets) on my folder on C drive. I have created a module in MS Access 2013 database. This module can be called using AutoExec macro. Basically I have created some scripts which will run a query and export the result into different excel files and then do the formatting. I need to transfer those excel files into SharePoint on daily basis. SharePoint is password protected. I am trying to automate the process. I use windows 7 OS, Office 2013. I am looking for a vba code/scrip or MS DOS/batch to do this work for me.

On SharePoint, there are some files already exist. I don't want to delete those files while I run script to transfer my reports into SharePoint.

Any support on this would be greatly appreciated.

Thanks
K
0
Hello Experts,

we have backup in e:\data\
e.g.
TERMSCLE31_07_2018_04_12.zip
SMECLE31_07_2018_04_18.zip
TERMSCLE01_08_2018_11_00.zip
SMECLE01_08_2018_11_05.zip
TERMSCLE02_08_2018_02_39.zip
SMECLE02_08_2018_02_45.zip
TERMSCLE03_08_2018_05_55.zip
SMECLE03_08_2018_05_56.zip

I want take backup on daily base from e:\data\<current date .zip> to two drives

e.g.
g:\ace\<create current date folder>\

k:\rule\<create current date folder>\

Please suggest this process how to done from batch script, after complete this task log (.txt or .csv) should be generated ?
0
Hi Folks,

is there a command or a way that will decipher what GPOs are being applied to a GroupMember ?
0
We have some upgraded going on some of our web severs.
Till that time we need check many urls manually daily.

I want to write a vb script to check urls if it is up or not and send us status report through mail.

urls address start with https:// and we need to use F5 Token and disable proxy setting to connect those server.

we don't have power shell access as well.

could somebody please help me to write a vbscript or bat script to automate these stuff.
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
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
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 a macro express pro app that I want to keep running in the background when my computer is on. For some reason, it stops functioning and terminates. But I don't know that until I go to call it up and I have to restart it. Also, it supposed to run at startup, but maybe windows doesn't like it, so it does not start with the other apps at startup. How do I use the task scheduler to make sure it starts at startup and also to check that it is running and if it is not running to relaunch it. the default path to the app is "C:\Program Files (x86)\Macro Express Pro\MacExp.exe" default directory is "C:\Program Files (x86)\Macro Express Pro"
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.