This batch script acts as a quick help button for employees in a company needing technical assistance. It allows users to send an automatic message to selected IT support within the company when they require help.
The script retrieves the sender's hostname and username, and then sends a notification to a predefined list of IT support staff. After the notifications are sent, the user receives a confirmation message informing them that technical service has been notified.
To run the script, the msg function must be available on your Windows system, which is standard in most corporate environments with Windows networks.
- Permission Requirements: The
msgcommand requires elevated permissions to send messages across the network. Ensure that users running the script have the necessary administrative rights. - User Context Limitation: If the script is executed under a different user account (e.g., using "Run as different user"), the sender may not receive the confirmation notification due to the different user context. It is recommended to run the script under the user's own account to ensure they receive all notifications.
- Copy the script into a directory on your computer.
- Open the command line and navigate to the directory where the script is stored.
To make the script easily accessible, you can pin it to the taskbar:
- Right-click on the desktop and choose "New" > "Shortcut".
- In the location field, type
cmd /c "path\to\your\batchfilename.bat", replacingpath\to\your\batchfilename.batwith the actual path to your batch file. - Click "Next", give the shortcut a name, and click "Finish".
- Right-click on the newly created shortcut and select "Pin to taskbar".
Now, you can quickly run the script by clicking the shortcut on your taskbar.
Adjust the list of recipients in the script to suit your specific needs:
RECEIVER1=username1 /SERVER:PCName1RECEIVER2=username2 /SERVER:PCName2RECEIVER3=username3 /SERVER:PCName3
These usernames and servers should correspond to the IT support users to be notified.
To execute the script, simply click the shortcut pinned to your taskbar.