Useful CMD Shell Script

Udah lama sekali g berkutat dengan shell script, dan ini jujur pertama kalinya main shell script di windows, biasanya di LINUX.

Coba saya save beberapa CMD Shell Script yang siapa tau saya bakal pake lagi di kemudian hari.

:: GET CURRENT DIR
cd %~dp0
 
:: COPY FOLDER
xcopy "Path of Source Folder" "Path of Destination Folder" /X /E /H /K /Y
 
:: REMOVE DIRECTORY
RMDIR "Path of Directory" /s
 
:: SCRIPT FOR REGISTER SERVICE, Ex : ServiceName
SC create ServiceName displayname= "Display of Service Name" binpath= "Path of Service exe" start= auto
 
:: SCRIPT FOR DELETE SERVICE, Ex : ServiceName
sc delete ServiceName

CMIIW :)

Leave a Reply

Your email address will not be published. Required fields are marked *

Afiseaza emoticoanele Locco.Ro