I am trying to run this script as administrator. When I run it without admin rights the log file is save in C:\Windows\System32. I put echo %~dp0 in the script and it echos to the current directory.
%~dp0
SC QUERY | FINDSTR "Fax"
IF ERRORLEVEL 0 SC CONFIG Fax START= DISABLED >> log.txt
If I hard set the log file as this:
%~dp0
SC QUERY | FINDSTR "Fax"
IF ERRORLEVEL 0 SC CONFIG Fax START= DISABLED >> C:\logs\log.txt
I can get a log in that location. But I only need to run it on machines with issues and I would like to have the file on the USB.