Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
This seems like a whitespace error, but I cant find the answer,
note~ I need the path string format as described below for output to .txt file...
Format of path string 'stored' in %profileE%"C:\Users\V1\AppData\Local\VirtualStore\Program Files (x86)\Activision\Call of Duty 4 - Modern Warfare\ "
Format of path string 'needed' in %profileE%C:\Users\V1\AppData\Local\VirtualStore\Program Files (x86)\Activision\Call of Duty 4 - Modern Warfare
----------------
trim pathString code and error
----------------
IF NOT %profileE%==0 set profileE=%profileE:~0,-3%echo on:\Activision\Call was unexpected at this time.
----------------
error code environment
----------------
SET profileE=0FOR...(
SET foundPlayersFolder="%%~DPa"
IF...(
IF...(
IF...(SET profileE=!foundPlayersFolder!)
)
)
)IF...(
IF NOT %profileE%==0 set profileE=%profileE:~1,-3%
)Warning Batch Newbie:
Thanks For Being Patient!
Any Help Is Appreciated!

I'v only shown the echo output for the line thats throws the error if thats what you mean?
actual message:
\Activision\Call was unexpected at this time.My batch code is quite large, what code would you like to see?, the code I'v posted already shows the pathString(foundPlayersFolder) being initialised(using an actual PATH) all the parts of its journey to where it(profileE) fails on being trimmed for output
...do you want to see all this code un-edited? or something else?
ps
other pathStrings work without any problem, and these working pathStrings appear to have fewer or no whitespacesWarning Batch Newbie:
Thanks For Being Patient!
Any Help Is Appreciated!

this is basically the same as what I posted before, but in its entirety
FOR /f "tokens=* delims= " %%a IN ('dir/s/b/a-s \players') DO (
SET foundPlayersFolder="%%~DPa"
ECHO.
ECHO.echo !foundPlayersFolder! | find "VirtualStore"
IF NOT errorlevel 1 (
ECHO.
ECHO.
----
echo. "WOULD YOU LIKE TO BACK-UP THIS PROFILE: ( Y )Yes BACK-UP ( N )NO CONTINUE SEARCHING ( Q )QUIT "
verify >nul
choice /N /C:YNQ
if errorlevel 1 set choice=Y
if errorlevel 2 set choice=N
if errorlevel 3 set choice=Q
IF /I !Choice!==Y (
REM Cls
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
echo SLOT E: !profileE!
echo SLOT F: !profileF!
echo SLOT G: !profileG!
echo SLOT H: !profileH!
ECHO.ECHO ENTER A SLOT LETTER: E, F, G, H, TO OVERWRITE WITH NEW PROFILE LOCATION
ECHO.
ECHO WARNING!!! THIS WILL OVERWRITE ANY LOCATION DATA STORED IN THE SLOT SELECTEDverify >nul
choice /N /C:EFGH
if errorlevel 1 set choice=E
if errorlevel 2 set choice=F
if errorlevel 3 set choice=G
if errorlevel 4 set choice=H
IF /I !Choice!==E SET profileE=!foundPlayersFolder!
IF /I !Choice!==F SET profileF=!foundPlayersFolder!
IF /I !Choice!==G SET profileG=!foundPlayersFolder!
IF /I !Choice!==H SET profileH=!foundPlayersFolder!echo SLOT E: !profileE!
echo SLOT F: !profileF!
echo SLOT G: !profileG!
echo SLOT H: !profileH!
)
IF /I !Choice!==N (ECHO NO)
IF /I !Choice!==Q (ECHO QUIT))
)
ECHO.
ECHO.
echo SLOT E: !profileE!
echo SLOT F: !profileF!
echo SLOT G: !profileG!
echo SLOT H: !profileH!ECHO PRESS S TO SAVE THE ABOVE PROFILE SLOTS TO FILE OR M TO RETURN TO MAIN MENU
choice /N /C:SM
IF errorlevel 1 set choice=S
IF errorlevel 2 set choice=M
ECHO SAVE
IF /I !Choice!==S (
@pause
IF NOT %profileE%==0 set profileE=%profileE:~1,-3%
IF NOT %profileF%==0 set profileF=%profileF:~0,-3%
IF NOT %ProfileG%==0 set profileG=%profileG:~0,-3%
IF NOT %ProfileH%==0 set profileH=%profileH:~0,-3%
@pauseWarning Batch Newbie:
Thanks For Being Patient!
Any Help Is Appreciated!

ECHO SAVE
IF /I !Choice!==S (
@pause
IF NOT %profileE%==0 set profileE=%profileE:~1,-3%
IF NOT %profileF%==0 set profileF=%profileF:~0,-3%
IF NOT %ProfileG%==0 set profileG=%profileG:~0,-3%
IF NOT %ProfileH%==0 set profileH=%profileH:~0,-3%
@pauseAh, your problem is either the lack of quotes, or the usage of % instead of !. Take your pick.

1)
Why is your yellow box wider than mine lol,it puts my long com's on 2 lines and makes it harder for u guys to read2)
Just to clarify, do you mean doing something like this:IF NOT !profileE!==0 set profileE=%profileE:~1,-3%
or
IF NOT "%profileE%"==0 set profileE=%profileE:~1,-3%Warning Batch Newbie:
Thanks For Being Patient!
Any Help Is Appreciated!

hmmmnn...maybe (x86) throws !profileE! and the whitespace after Program throws "%profileE%"
profileE
=
"C:\Users\V1\AppData\Local\VirtualStore\Program Files (x86)\Activision\Call of Duty 4 - Modern Warfare\"
-----IF NOT !profileE!==0 set profileE=%profileE:~1,-3%
\Activision\Call was unexpected at this time.IF NOT "%profileE%"==0 set profileE=%profileE:~1,-3%
Files was unexpected at this time.I need the code to handle unknown pathStrings regardles of whitespaces, etc...other pathstrings using !profileE! or %profileE% work perfectly???
eg
"C:\Users\V1\Desktop\test\cod4 profile flagger\uac on\VirtualStore"Warning Batch Newbie:
Thanks For Being Patient!
Any Help Is Appreciated!

![]() |
c++ - path question
|
Exec Perl script from Ult...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |