Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
im having this weird problem..in fix.bat, %%? should be the filename.. but it isnt.
first when get_item_dsc=1 i call a batch file in the items folder, it returns %activatekey%, and then it should compare the userinput with %activatekey%, and then it should again call the same batch file but this time with get_item_dsc=0.
but its not working could somebody please give my script the finishing touch?
the error i have (4 times repeated) with any userinput i give:
'\My_Batch_menu\items\?' is not recognized as an internal or external command,
operable program or batch file.
Called the fileFOR %%? IN (*.bat) DO call %folder_runfiles%\fix.bat
fix.bat:
@echo off
set get_item_dsc=1
call %folder_runfiles%\items\%%?
set get_item_dsc=0if not %userinp%==%activatekey% goto skip
call %folder_runfiles%\items\%%?
echo Called the file
goto end
:skip
echo skipped a file
:endPS im fully aware this is a crosspost and my topic in WindowsXP forum should be deleted not this one (A)

Try this, I think it's what your trying to do.
You need to pass the bat file as a parameter which becomes %1 to fix.bat
FOR %%? IN (*.bat) DO call %folder_runfiles%\fix.bat %%?fix.bat:
@echo off
set get_item_dsc=1
call %folder_runfiles%\items\%1
set get_item_dsc=0if not %userinp%==%activatekey% goto skip
call %folder_runfiles%\items\%1
echo Called the file
goto end
:skip
echo skipped a file
:end

Hi
The for command calls fix.bat with the *.bat file names as a parameter.
say you have two batch files called One.bat & Two.bat in the current directory, then fix.bat is called twice like this..
"call %folder_runfiles%\fix.bat One.bat"
and again as...
"call %folder_runfiles%\fix.bat Two.bat"
One.bat & Two.bat are your %%?
But to the batch file fix.bat %%? would be refered to as %1
If there were two parameters then the second one is refered to as %2. %0 refers to the filename itself ie. fix.batso if fix.bat have this command in it.
echo %0 %1
it would be called twice in my case and echo to the screen.
fix.bat One.bat
fix.bat Two.batHope this helps

hi i now have this
FOR %%? IN (*.bat) DO call %folder_runfiles%\fix.bat %%?fix.bat:
set get_item_dsc="1"
call %folder_runfiles%\items\%1
set get_item_dsc="0"
if %userinp%==%activatekey% call %folder_runfiles%\items\%1now the last if simply gets ignored and it calls every file every time..
if i check with echo on it says
c:\blabla\if a==b call blabla
c:\blabla\call blablait just simply calls the file even when i dont want to..

let me explain my happiness :D
ive made some simple script that allows me to make very simple formatted batch files
like thisset activatekey=A
set item_dsc= 2- Kill Instant messengersecho %activatekey% ----- %item_dsc%
if %get_item_dsc%=="1" goto skiprem launch stuff here
taskkill /F /IM miranda32.exe /IM msmsgr.exe /IM msnmsgr.exe /IM MSN_Winamp_auto_nick_changer_V.1.0.exe:skip
this menu script doesnt works with errorlevels (Except a few). instead, it checks in every batch file if activatekey is same as the userinput.. if so it launches the file again but then with get_item_dsc=0 and i think it r0x0rs cuz its gonna save me alot of time and rsi :)

oh i forgot it only checks ofcourse the batch files in the items folder so its kinda plugin system you make a new batch file and it automatically pops up in the menu :D
its really kewl to work with combining with EZmacros export to exe function etc...

![]() |
![]() |
![]() |

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