
I have made a simple batch script that checks for the server hostname
if the servername eguals srv012 then run powershell script (this powershell script changes the contents of a ini) and then run exe file and then waits 50 seconds and reboot. Some issues here: if the computername iguals the actual hostname, do nothing and to go to end with text !!INI CONTENTS NOT CHANGED!! something is wrong in my code.. please help. Thanks in advance
@echo off
if "%COMPUTERNAME%" == "srv012" goto :RUN
:RUN
Powershell.exe -executionpolicy remotesigned -File c:\gts\replace_hostname.ps1
c:\foldername\programname.exe
timeout /t 50
shutdown /r
:eof
echo !!INI CONTENTS Not CHANGED!!
PAUSE