Batch Scripts

Batch scripts can be useful in automating a specific task that you need to repeat often. The easiest way to make them is to open a new file in Notepad ++

Some basic commands for batch scripts include

ECHO OFF = You will no longer see what commands are being inputted
ECHO hello my name is = This will print "hello my name is"
IPCONFIG /ALL = Displays the users network configurations
PAUSE = This lets the user stop and see what is going on as it will require a keyboard input to continue
NET USE = This is used to map network drives

Here are a couple of examples of basic batch scripts:

net use G: \\computer1-1111\D$ /Persistent:yes
net use H: \\computer2-2222\D$ /Persistent:yes
net use I: \\computer3-3333\D$ /Persistent:yes

The above script would be used to map this network drives to the appropriate drive letter.

MsiExec.exe /X{.....}
MsiExec.exe /X{.....}
Example.exe
\\10.10.10.10\Folder1\Folder2\ Folder3\file1.exe
\\11.11.11.11\Folder1\Folder2\ Folder3\file2.exe
pause

The above script could be used to uninstall some programs then install a specific program and then re-install the removed programs.

Once the script is written all you need to do is save it as a batch file with a .bat file extension

Batch Script

If you would like to run a batch script silently in the background you can call it using a VBS script.

Set WshShell = CreateObject("WScript.Shell")
WshShell.RUN "cmd /c c:\Folder1\example1.bat", 0

Be sure to change the C:\Folder1\example.bat to the appropriate location of your batch file

You can also have this run when the user logins to the computer by placing it in their startup folder. C:\Users\johnd\AppData\Roaming\Microsoft\ Windows\Start Menu\Programs\Startup

An easy way to open the Startup Folder is to use Run and type in shell:startup

Shell-Startup