A Cmd scripts which makes life easier.
- SkypeSecondary - Add to autostart variables second instance of Skype
- SkypeRemoveAdds - Block and remove adds from Skype
- AddContextMenuPowershell - Add to Explore context menu "Open folder in Powershell" and "Run Bypass/Admin ps1 script"
- EvaluatedRun - Execute script/executable as Admin
- [Which.cmd] (#whichcmd) - Determine file full path(linux
Whichanalogue) - [PKill.cmd] (#pkillcmd) - Kill windows app by name(
taskkillsimple wrapper to be more like linuxpkillcommand) - [Ps.cmd] (#pscmd) - List process (
tasklistsimple wrapper to be more like linuxpscommand) - RunPowershell - Run powershell script with "Bypass"
- MsBuild - Run msbuild.exe
- WebDownload - download file from web
- Unzip - extract archive content
- AddPath - add directory to Env:Path
- BuildInstaller - Create installer from folder content
- InstallBin - download scripts dependencies
- CmdAutoRun - add folder to Cmd.exe autostart
- CmdEnv - set Cmd.exe aliaeses and Path variable
- SvnCheckout - Checkout svn(with injections) and build
- Config - Init/Load config file
- Copy - Copy folder content
- AddRoutesTemplate - template for RouteConfig scripts
##The easiest way to get all scripts: Press Win+R keyboard hotkeys and insert into the window entire script provided below:
powershell.exe -executionpolicy bypass "$dst=Read-Host 'Enter install folder:';$repo='https://github.com/stadub/CmdScripts/archive/master.zip';$f=[System.IO.Path]::GetTempFileName()+'.zip';New-Object System.Net.WebClient|%{$_.DownloadFile($repo,$f);};$sh=New-Object -ComObject Shell.Application;$ar=$sh.NameSpace($f).Items();$af=$ar.Item(0).GetFolder.Items();mkdir $dst;$d=$sh.NameSpace($dst);$d.CopyHere($af, 272);& $dst\InstallBin.cmd;Write-Warning 'Add scripts to autorun?' -warningaction Inquire;& $dst\CmdAutoRun.cmd;pause"
#Runtime configuration scripts:
Helper script that fetch all scripts(Mainly Build.cmd) dependencies from the internet
InstallBin.cmd
Add CmdEnv.cmd to Command line autorun.
Helper script install aliases for scripts and insert scripts directory to the Path variable.
Also loads aliases from files pointed in the DoskeyScripts env variale
InstallBin.cmd
#One-time usage useful utilities: #
Add to autorun entry which runs second Skype instance
Remove Adds from Skype
Add Open PowerShell Here entry to the Explorer directory context menu
Shell script to allow to run commands with evaluated privileges
- Automatically resolves path to executable (from
%Path%variable) - In case of Admin shell(or disable UAC) just starts command
Example:
EvaluatedRun.cmd notepad C:\text.txtShell script to resolve path to executable (bat/cmd/exe files supported)
Example:
Which.cmd notepadKill windows app by name.
Just handy taskkill wrapper.
Example:
pkill.cmd note*List process.
Just handy tasklist wrapper.
Example:
ps.cmd note*Script is intended to run Powershell scripts from command line.
Allows to avoid execution of scripts is disabled on this system message.
Example:
RunPowershell.cmd lsResolves location of the msbuild launcher to run msbuild project
Usage:
MsBuild.cmd myproject.projectCopies current folder content to the folder set by arg
Copy.bat c:\
Download web resource
WebDownload.cmd https://github.com/stadub/CmdScripts/archive/master.zip c:\Sources\CmdScripts.zip
Extract archive content
Unzip.cmd %CD%\CmdScripts.zip %CD%
Add directory to PATH environment variable
AddPath.cmd c:\Sources\CmdScripts
Installer script.
Require unpacked http://www.7-zip.org/a/7z920_extra.7z utils in the /bin directory.
##To install dependencies run InstallBin.com before installer script execution##
Usage:
To create installer generator script run:
Build.cmd [MyApp]
Sample Build.cmd Output:
Enter Application name:> MyApp
Starting installer configuration for MyApp
Enter value for BeginPrompt:> Do you want to install MyApp?
Enter value for SrcDir:> C:\Sources\MyApp
Enter value for DestDir:> C:\Program Files\MyApp
Application installer script generated successfully.
Use "c:\Sources\CmdScripts\Build_MyApp.cmd" to start installer script.
Press any key to continue . . .Config variables
BeginPrompt="Do you want to install MyApp?" - The prompt will be shown during installation process
SrcDir="C:\Work\MyApp\Release\bin" - Directory with application being installed
DestDir="C:\Program Files\MyApp" - Directory application being installed
Description: Create installer script based on 7z SFX.
Create archive from %SrcDir% content and create SFX installer by combining 7zS.sfx + 7zConfig + Installer.7z to AppInstaller.exe
Installation performs copying archive content to the %DestDir% folder
Batch file template to create a routing file
Usage:
AddRoutes.batAllows to checkout svn repos via single script.
Script can be added to scheduler.
The "comon" repository that should be injected to the other repositories(external repo).
SvnCheckout.cfg contain properties to configure script.
Configuration scripts. Used as part of the other scripts to add script config files support.
Has 2 mode:
-
Interactive variables initialization when
configfile variableInitset toFalse -
Creates variables from file when
configfile variableInitset toTrue
Usage:
Config file: Build.config
Init=False
Title=""
Config.bat build
Output:
Write variable Init="True"
Enter value for Title:My App
Write variable Title="My App"
1 file(s) moved.
1 file(s) moved.
Setting var Init "True"
Setting var Title "My App"