| 1. |
Solve : Can a batchfile make another file to remember something?? |
|
Answer» Hey guys, I was wondering if it's possible to make another FILE which stores something from the original batchfile so you can skip a part of the batch file? I think it's kinda annoying if you'd have to do that. In a batch you can create a variable.Can you put an EXAMPLE please? Thanks Code: [Select]:1 IF EXIST TorrentClientChoice.txt ( set /p L=<TorrentClientChoice.txt GOTO loaded ) ECHO What Torrent Downloader are you using? ECHO 1: µTorrent ECHO 2: BitTorrent ECHO 3: Vuze ECHO 4: BitComet ECHO. ECHO If there is any other Client you are using, notify me ECHO and I'll add it to the list ;) ECHO. SET /P L=Type your desired number and press ENTER: >TorrentClientChoice.txt echo %L% echo Preference %L% saved :loaded IF %L%==1 SET TORRENT=%HOMEDRIVE%\Program Files\uTorrent\uTorrent.exe IF %L%==2 SET TORRENT=%HOMEDRIVE%\Program Files\BitTorrent\bittorrent.exe IF %L%==3 SET TORRENT=%HOMEDRIVE%\Program Files\Vuze\Azureus.exe IF %L%==4 SET TORRENT=%HOMEDRIVE%\Program Files\BitComet\bitcomet.exe --------------------- --------------------- < Other part of the file, not necessary --------------------- ECHO Start %TORRENT%? SET /P N=Type y [yes] or n [no], then press ENTER. IF %N%==y GOTO SBIT IF %N%==n GOTO FOX GOTO BIT :SBIT ECHO. Start "" /min "%TORRENT%" ECHO. ECHO %TORRENT% started minimized. Quote from: Ghosty on August 05, 2010, 10:24:34 AM Can you put an example please? He is joking. Quote from: Salmon Trout on August 05, 2010, 10:36:50 AM He is joking.Lol... No To be honest not xD I never learned this part of batch (until now) I'm sorry And thanks a lot for helping PS: what was the double post for? Quote from: Ghosty on August 05, 2010, 11:23:52 AM PS: what was the double post for? What double post? Quote from: Salmon Trout on August 05, 2010, 11:27:02 AM What double post? Lol First I asked for an example. Then you posted the code which helped me Then you posted that I was joking (which I wasn't) Quote from: Ghosty on August 05, 2010, 12:37:45 PM
Do you have trouble understanding how quoting works in forums? I'll try to put it simply for you. 1. Geek-9pm posted in that "batch variables live forever". This is (obviously) not true, and I think he meant it as a joke. (not very funny in my opinion.) 2. You (Ghosty) quoted Geek-9pm saying that, and underneath asked for an example, and from that it seemed that you thought he was serious (now that is funny.) 3. I (Salmon Trout) quoted you (Ghosty) asking for an example, and wrote underneath that he (Geek-9pm) was joking. Quote from: Salmon Trout on August 05, 2010, 12:55:34 PM Do you have trouble understanding how quoting works in forums? I'll try to put it simply for you.Lol... Oops Oversaw that it was him and not you lol SORRY MY FAULT I WENT through it too quickly HOWEVER You DID double post Your first post was "He is joking." The post after that you made was the code Quote from: Ghosty on August 05, 2010, 01:08:29 PM You DID double post You don't KNOW what "double posting" is. It is when somebody makes the same post twice, sometimes in the same THREAD, by accident, or sometimes when they start two threads with the same first post. What I did was make two separate posts, which were different from each other. Quote Your first post was "He is joking." The post after that you made was the code Actually, it was the other way around. Quote from: Salmon Trout on August 05, 2010, 01:19:33 PM You don't know what "double posting" is. It is when somebody makes the same post twice, sometimes in the same thread, by accident, or sometimes when they start two threads with the same first post. What I did was make two separate posts, which were different from each other. Maybe in the forums where you post, but not in mine. When I post two different posts after each other in the same topic, they count it as double post. Quote from: Salmon Trout on August 05, 2010, 01:19:33 PM Actually, it was the other way around. True about that one lol... I was editing my post and it looked the other way around, I got somewhat confused (chatting with four people at the same time ) Quote from: Ghosty on August 05, 2010, 01:22:42 PM Maybe in the forums where you post, but not in mine. This is a "forum where I post", in case you hadn't noticed. Quote from: Salmon Trout on August 05, 2010, 01:29:36 PM This is a "forum where I post", in case you hadn't noticed.It would be dumb from me not to notice that you posted here. The point is that I'm used to the situation I wrote about the double post. ANYWAY let's stop this crap this is entirely off-topic I assume that there's a way to make more than one command in a single line. For example Code: [Select]IF this=that, then do this AND this instead of putting the commands in multiple lines.You can use the ampersand & symbol to link multiple commands on the same line Code: [Select]if "%var%"=="egg" echo yolk & echo white |
|