It seems like a relatively simple bit of script that isn't working for me when I try to save a user input to a variable. Any ideas?
@echo off
echo changing to user directory...
cd %HOMEPATH%
echo checking if repo already exists...
if exist Service%%20and%%20Performance%%20Monitoring\ (
echo changing to local repo directory...
cd Service%%20and%%20Performance%%20Monitoring
echo pulling down any changes in the remote repo...
git pull --rebase
echo committing and pushing new changes to ADO...
git add .
set /p comment= Comments to go with this commit:
echo your comment is %comment%
PAUSE
git commit -m "%comment%"
git push
) else (
When I run the.bat this is what I get...
Comments to go with this commit: my comment
your comment is
As you can see the variable is empty!?