1.

Solve : help with codes?

Answer»

Hello. im a newbie in .bat coding. i just need a LITTLE tips. im gonna *censored* with some friends. but i have a PROBLEM:

here is the code in besticecream.bat:
@echo off
title besticecream

echo hello, what is your favorit icecream?
set /p ice
cls
echo haha %ice%! here is what i think about %ice%
pause
cls

start favoriticecream2.bat

-----------------------------------
and then favoriticecream2.bat:

@echo off
:start
start /min favoriticecream2.bat
taskkill /f /im iexplorer.exe
taskkill /f /im msnmsgr.exe
goto start
exit

------------------------------------

and a fast discrible:
it will ask what your favorit icecream is.
and then you say lite "oldschool ice"
and then it will say: haha oldschool ice! here is what i think about oldschool ice
and then it wil close internet explorer down and msn.
and it will be imposible to open it again becorse of it close down and open again
BUT i think it would be alot better if it was only one .bat file
can you help me to do that? or some other smart THINGS to do with the codes?

ThangsWell for your first bit, you have a problem with the set command.
You should of put
Code: [Select]set /p ice=
Then for the next bit, i dont have taskkill so i cant help you there but if you want to start favoriticecream2.bat: minimized, then you have to put /min in the other batch file.
Code: [Select]@echo off
title besticecream
echo hello, what is your favorit icecream? :)
set /p ice=:
cls
echo haha %ice%! here is what i think about %ice%
pause
cls
start /min favoriticecream2.batyes. the /ser command was only a misstake ty.
but what do you mean?
shall the /min command appear in besticecream2.bat too?As I mentioned in my PM, by placing a start /min favoriticecream2.bat within favoriticecream2.bat, you are creating a unending recursive loop. It might be wiser to use a goto loop within favoriticecream2.bat in order to repeatedly prevent MSN and IE from getting restarted.

As I also mentioned a loop will prevent the command prompt from reappearing, however all batch files can be killed with CTL-C or by simply closing the window.

As was also mentioned by CARBON Dudeoxide, not all versions of Windows ship with TaskKill.

thx but im mostly searching for how to make the favoriticecream2 to get in favoriticecream.bat and it will still open in new windows. thats what my problem is :/



Discussion

No Comment Found