ITTec Posted April 20, 2016 Posted April 20, 2016 Hi All Currently I have setup bat files that deliver predefined alerts such as "indoor break" to specific computers that SLT are able to run. I do this with the following: msg * /server:COMPUTERNAME /time:600 ALERTTOSEND What I would like to do is allow SLT to write there own alerts instead of having predefined alerts and was wondering if anyone knows a way of doing this? Email is not really an option as staff don't always check and they want the alert to be on top of any other open windows. I know you can buy software for this but don't really want to spend any money to achieve this. Thanks ITTec
ITTec Posted April 21, 2016 Author Posted April 21, 2016 Simple vb gui to create and run bat file? Thanks rrrrr. I have setup a GUI for it using Visual studio and sorted out a different job on my list through this. Unfortunately my VB scripting is not great and I cant figure out the last part I need. Basically what I want to happen when they press send is: -copy file from location A to B -replace # within the file to whatever text they have put in the textbox in the GUI -run the bat file Any help would be appreciated.
Stuajnht Posted April 21, 2016 Posted April 21, 2016 Could you not just modify your current batch file to accept a message to be typed in? Something like the following (quickly knocked up with stuff mostly taken from www.ss64.com): @echo off REM Sends the specified message to the computers listed in computers.txt :MESSAGE cls title Please Enter Message set /P _message=Please enter message to send: || Set _message=NothingTyped if "%_message%"=="NothingTyped" goto :MESSAGE :SENDING cls title Sending Message echo Sending Message: %_message% echo =============================================== FOR /F %%G IN (computers.txt) DO ( echo Sending message to computer: %%G msg * /server:%%G /time:600 "%_message%" >nul 2>&1 ) echo =============================================== title Message Sending Completed echo Message sent to all defined computers echo. echo Press any key to close this window pause > nul Save it as message.bat, and create a computers.txt file in the same folder, with a name of each computer on one line, e.g.: PC01 PC02 OFFLINEPC PCnn It'll then work pretty much the same way as it currently does. Remove the >nul 2>&1 from the end of line 18 if you want to see any error messages. 1
ITTec Posted April 22, 2016 Author Posted April 22, 2016 Just sorted this with a GUI and got rid of the bat files using Visual C#. Thank you both for your inputs.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now