And once again I'm having problem with a batch file, it's the same batch as before, save a log everytime it opens and lots of other things.
But as it seems it's not working again, here's the part of the code that doesn't work:
Code: Select all
set opwp=false
set didauthcheck=false
@echo off &setlocal enableDelayedExpansion
if !didauthcheck! == false (
cd C:\Users\Admin\AppData\Roaming\WCMP\logs
if exist "location" (
< location set /p "locationl="
cd %locationl%
)
< log.txt (
set /p "line1="
set /p "line2="
)
if exist "pwp" (
set opwp=true
)
if !%line2! == "Accces Not Authorized" (
cd c:\users\admin\desktop\
echo "Session at %line1% was not auhorized or the password was not provided/was wrong.">log.txt
if !opwp! == true (
cd %locationl%
< pwp set /p "pp="
cd c:\users\admin\desktop
echo The provided password was "%pp%".>>log.txt
)
)
)
Every directory exists and (I think) all variables are set too.
Here's the output on the CMD window:
Code: Select all
C:\>code.bat
C:\>set opwp=false
C:\>set didauthcheck=false
C:\Users\Admin\AppData\Roaming\WCMP\logs
O sistema não conseguiu localizar o ficheiro especificado. (The system couldn't find the specific directory or file.)
The directory "C:\Users\Admin\AppData\Roaming\WCMP\logs" exist, I've tried everything I could but nothing did the trick.
If you can correct it please post the fix and what you changed to make it work (if you can).
If you need any other information about the code don't hesitate to ask.
Thanks for reading
