background preloader

Command line (Dos)

Facebook Twitter

Using batch parameters. Windows XP - Using batch parameters. Writing comments in Bat Files - GdP Software. It is always a good idea to write comments in your bat-files.

Writing comments in Bat Files - GdP Software

Your comments will help you to understand your own bat-files later on. More important: they help others to understand how it all works. The REM statement This is the most common way to write comments. Any line in your bat-file that starts with REM is completely ignored by the command-processor. REM This bat-file moves all files in C:\Incoming to C:\ToProcess REM Written by Gert Rijs REM 05/01/2003 Double Colons Alternatively you can replace the word REM by two colons. :: This bat-file moves all files in C:\Incoming to C:\ToProcess :: Written by Gert Rijs :: 05/01/2003 Block comments Very often you would like to write multiple lines of comment.

GOTO EndComment This bat-file moves all files in C:\Incoming to C:\ToProcess Written by Gert Rijs 05/01/2003 :EndComment To help others understand what is going on, be sure to name the goto-label something like EndComment. All trademarks are the property of their respective owners.

DOS - String Manipulation

SetX - Set environment variables. Set environment variables permanently, SETX can be used to set Environment Variables for the machine (HKLM) or currently logged on user (HKCU): Syntax SETX [/s Computer [Credentials]] Variable Value [/m] SETX [/s Computer [Credentials]] [Variable] /k RegistryPath [/m] SETX [/s Computer [Credentials]] /f FileName {[Variable] {/a L,T | /r oL,oT "SearchString"} [/m] | /x} [/d Delimiters] Key: /s Computer The name or IP address of a remote computer.

SetX - Set environment variables

Do not use backslashes. (default = the local computer) Credentials The username and password used to connect to Computer: /u [Domain\]UserName [/p [Password]]] /u [Domain\]UserName Run the script with the credentials of the specified user account. The default value is the system permissions. /p [Password] The password of the user account that is specified in the /u parameter. Environment variables are stored in the registry: Machine variables are stored on the machine and will not follow a users roaming profile. String Value Mode Registry Mode. For DOS command help. Quick links About forAvailabilitySyntaxExamples About for The FOR variable is used for batch files to run a specified command when a parameter is met or specified.

for DOS command help

Echo (DOS)

XCOPY. Example[edit] Create a new directory by copying all contents of the existing directory, including any files or subdirectories having the "hidden" or "system" attributes and empty directories. xcopy e:\existing e:\newcopy /s /e /i /h If the directory names include blank signs(spaces), the names can be put in quotation marks. xcopy "D:\Documents and Settings\MY.USERNAME\My Documents\*" "E:\MYBACKUP\My Documents\" /D/E/C/Y.


Sauvegardes manuelles: Xcopy et Robocopy - Win Vista - Windows & Software. Feature Comparison: XXCOPY vs ROBOCOPY. [ Back to Table of Contents ] [ << ] [ >> ] From: Kan Yabumoto To: XXCOPY user Subject: Feature comparison: XXCOPY vs ROBOCOPY Date: 2002-12-03 (Revised) =============================================================================== Introduction: Since we receive a large number of inquiries about XXCOPY's relative strength and weakness against ROBOCOPY, the administrator's tool bundled with Microsoft's Windows NT/2000/XP Reseource Kit, this article was created to contrast the two utilities.

Feature Comparison: XXCOPY vs ROBOCOPY

Apparently, ROBOCOPY (which stands for Robust Copy) and XXCOPY both come from Microsoft's XCOPY utility as the basis for the overall approach which of course comes from COMMAND.COM's built-in COPY command. As its name implies, XXCOPY adheres to XCOPY's general behavior very closely. BoxCryptor – Le chiffrement pour Dropbox. Liste des commandes Windows - La solution. Suppression Recursive et RDMIR, FOR et DIR [RESOLU] - Shell/Batch - Programmation.

For exmple in order to erase all '.svn' folder of a projet : for /F "tokens=*" %%i IN ('dir /a:d /b /s *.svn') DO rmdir /S /Q "%%i" – drone

Visual Command Line – Un éditeur pour vos batchs. Batfiles: The DOS batch file programming handbook & Tutorial. DOS Command: SUBST. The description below is from the bookDOS the Easy Way by Everett Murdock Ph.D.

DOS Command: SUBST

CLICK HERE for information about downloading the book. Type: External (3.1 and later) Syntax: SUBST d: d:path SUBST d: /D Purpose: Substitutes a virtual drive letter for a path designation. Discussion Use the SUBST command to substitute a drive letter for a path in order to treat a virtual drive (a reserved area rather than an actual disk drive) as a physical drive.

In order to enter drive designations using any letter (other than just the letters for the physical drives installed in your computer), you may have to add this line to a CONFIG.SYS file that should be placed in the root directory of your startup drive: Six DOS commands cannot be used with virtual drives created with the SUBST command. CHKDSK DISKCOPY FDISK FORMAT LABEL SYS If you enter the SUBST command without options , the program will display the name of the current virtual drives that are in effect (if any). Mklink in Windows. Mklink is a MS Windows command line utility that you can use to create symbolic links or symlinks and hard links in MS Windows.

Mklink in Windows

Mklink is a nice tool for troubleshooting file system problems. Mklink requires administrative privileges. This page relates to explaining the difference between symbolic links and hard links on the Difference between symbolic link and hard link page. First, let's introduce the mklink command. You can see it in the following print screen: It is pretty self-explanatory. Mklink example The print screen shown below demonstrates creating symbolic links, hard links, and shortcuts in MS Windows and how they differ. Symbolic link: Hard link: Shortcut: The print screen below shows these concepts. Linux uses a similar command called ln. Mklink in Windows versus Ln in Linux Note, the mklink syntax is a bit different from the Linux ln syntax (ln is used in Linux to create links).

Mklink: The name of the link is followed by the name of the target in the mklink command syntax. Wait for file to exist (dos batch command) START command (Microsoft DOS )