SHOW:
|
|
- or go back to the newest paste.
1 | :: Aliases version 1.0.0 | |
2 | - | :: 1) Creates following files in %USERPROFILE%\\dev\\: |
2 | + | :: By Mor Merhav |
3 | - | :: - env.cmd |
3 | + | |
4 | - | :: - regenv.reg |
4 | + | |
5 | - | :: 2) Runs regenv.reg |
5 | + | :: 1) Creates following file in %USERPROFILE%\\dev\\: |
6 | - | :: |
6 | + | :: - aliases.cmd |
7 | - | :: The result is that everything in env.cmd is run automatically each time a CMD terminal session is opened. |
7 | + | :: 2) Adds 'Autorun' value to registry: %USERPROFILE%\\dev\\aliases.cmd |
8 | - | :: You can now add to env.cmd whatever aliases/quick commands (using doskey) you wish! |
8 | + | :: |
9 | :: The result is that everything in aliases.cmd is run automatically each time a CMD terminal session is opened. | |
10 | :: You can now add to aliases.cmd whatever aliases/quick commands (using doskey) you wish! | |
11 | ||
12 | mkdir %USERPROFILE%\\dev\\ | |
13 | - | @echo Creating 'env.cmd' file... |
13 | + | |
14 | @echo Creating 'aliases.cmd' file... | |
15 | ||
16 | - | @echo @echo off > %USERPROFILE%\\dev\\env.cmd |
16 | + | |
17 | - | @echo doskey mci=mvn clean install -DskipTests >> %USERPROFILE%\\dev\\env.cmd |
17 | + | @echo @echo off > %USERPROFILE%\\dev\\aliases.cmd |
18 | - | @echo doskey mvn_versions=mvn versions:set -DnewVersion=$1 $T mvn versions:commit >> %USERPROFILE%\\dev\\env.cmd |
18 | + | @echo echo Running with Aliases version "1.0.0" >> %USERPROFILE%\\dev\\aliases.cmd |
19 | @echo doskey mci=mvn clean install -DskipTests >> %USERPROFILE%\\dev\\aliases.cmd | |
20 | @echo doskey mvn_versions=mvn versions:set -DnewVersion=$1 $T mvn versions:commit >> %USERPROFILE%\\dev\\aliases.cmd | |
21 | - | @echo Creating 'regenv.reg' file... |
21 | + | @echo doskey aliases=doskey /macros >> %USERPROFILE%\\dev\\aliases.cmd |
22 | ||
23 | @echo on | |
24 | - | @echo Windows Registry Editor Version 5.00 > %USERPROFILE%\\dev\\regenv.reg |
24 | + | @echo Creating registery value 'Autorun' ... |
25 | - | @echo [HKEY_CURRENT_USER\Software\Microsoft\Command Processor] >> %USERPROFILE%\\dev\\regenv.reg |
25 | + | |
26 | - | @echo "AutoRun"="%%USERPROFILE%%\\dev\\env.cmd" >> %USERPROFILE%\\dev\\regenv.reg |
26 | + | start /wait reg add "HKCU\Software\Microsoft\Command Processor" /v Autorun /t REG_SZ /d %USERPROFILE%\\dev\\aliases.cmd |
27 | if errorlevel 1 ( | |
28 | @echo on | |
29 | - | @echo Running 'regenv.reg' file... |
29 | + | echo Registry key creation failed with error: [%errorlevel%] from reg.exe |
30 | - | regedit.exe /s %USERPROFILE%\\dev\\regenv.reg |
30 | + | pause |
31 | - | @echo Env install finished successfuly ! |
31 | + | exit /b %errorlevel% |
32 | ) | |
33 | @echo on | |
34 | @echo Aliases installation finished successfuly! | |
35 | ||
36 | pause |