Copies a set of folders excluding certain sub-folders; f.i. exclude .git
folder (which can quickly be a very big folder), node_modules
and vendor
which are unneeded because they can be reconstructed with an npm install
and a composer update
.
cd c:\repositories
robocopy . c:\backup\. /IS /S /XD .git node_modules vendor
These two lines will allow you to copy everything from c:\repositories
to c:\backup
, rewrite files even if they're present in the backup folder, copying symlinked folder and exclude a few folders.
source https://www.howtogeek.com/354220/how-to-enable-case-sensitive-folders-on-windows-10/
Under DOS / Windows, filenames are not case sensitive. This means that myFile.php
, myfile.php
, MYFILE.PhP
and all others variants are one unique file.
To try this, just open a DOS Prompt Session and run these three commands. Did you get three new files in your current folder? No, just myFile.php
, the first created one.
Open that file? What did you see? His content will be This is MYFILE.PhP
i.e. the result of our third command.
Other OS like Linux are case sensitive and we'll then get there three files with the correct content each time.
echo "This is myFile.php" > myFile.php
echo "This is myfile.php" > myfile.php
echo "This is MYFILE.PhP" > MYFILE.PhP
Is it possible to enable case sensitivity under DOS? Yeah! It's possible.
- Start a
Windows PowerShell
prompt with admin rights, - Go inside the folder where you want to enable case sensitivity,
- Type
fsutil.exe file setCaseSensitiveInfo . enable
to enable it (ordisable
to remove it)
Check once more:
As you can see, now, we've our three files and the content of tye myFile.php
is well This is myFile.php
, as expected. Same for the two others files.
If you're a PHP programmer f.i., enabling case sensitivity is nice because you'll directly see under Windows a fatal error on require_once myFILE.php
since that file didn't exists.
By running CMD
, Windows will start the DOS Prompt and you'll be located in your user profile folder (%USERPROFILE%
)
You can change this behavior by either updating the command prompt Start in property or by creating a new entry in your registry.
-
Start the File Explorer
-
Go to
%APPDATA%\Microsoft\Windows\Start Menu\Programs\System Tools
-
Right-click on the
Command Prompt
shortcut -
Update the
Start in
property to the default folder of your choice. Note: you can also decide to start the DOS prompt console maximized.
- Run
regedit
- Navigate to
Computer\HKEY_CURRENT_USER\Software\Microsoft\Command Processor
- Create a new key
Autorun
, string one - Type a
cd
(change directory) command followed by your preferred one likeIF /I x"%COMSPEC%"==x%CMDCMDLINE% (cd /D c:\christophe\repositories)
The IF
statement here above allows to execute the cd
command only when the DOS prompt is started from the CMD
command under Windows and not from a current, existing, DOS session.
From now, when you'll start CMD
you'll be directly in that folder.