0
We have a virtual machine (via Azure) in our office environment. In this VM we run Python scripts to analyse the data we pull.
There are five of us on the team, and every time one of us goes on whilst someone else is in the VM, the person already on gets kicked off.
Is there a way to push a prompt of the VM that asks if anyone is on, with Yes or No buttons? Currently I have this code in a batch file:
@echo off
echo code=Msgbox("Is someone one the VM?", vbYesNo, "VM?") > "%temp%\popupBox.vbs"
echo WScript.Quit code >> "%temp%\popupBox.vbs"
cscript /nologo "%temp%\popupBox.vbs"
if %errorlevel%==7 call :cancel_tag
if %errorlevel%==6 call :ok_tag
exit /b 1
:ok_tag
echo Yes I am!
exit /b
:cancel_tag
echo No!
exit /b
This obviously only works on the computer you are using, I was hoping to find a way to have this pushed onto the VM and if someone presses 'Yes' then nothing happens. If someone presses 'No' or there is a time delay where no one answers (as there is no one on the VM) then it will run another batch file that we have that automatically logs into the VM for you. Is this doable?
So far we have tried looking for solutions in cmd or PowerShell as the VM has these pre-installed, but our team has experience using different forms of code so would be willing to tried other forms that would work.
Msg
and Net Send
is not working for us. We are using Windows 10.
Thanks,
Mammoth