

InterviewSolution
Saved Bookmarks
1. |
Solve : Can a batchfile make another file to remember something?? |
Answer» <html><body><p>Hey guys, I was wondering if it's possible to make another <a href="https://interviewquestions.tuteehub.com/tag/file-11330" style="font-weight:bold;" target="_blank" title="Click to know more about FILE">FILE</a> 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.<br/>Lol I hope you understand...<br/><br/><br/>Here's the code<br/><br/> Code: <a>[Select]</a>:1<br/>IF EXIST "" "Save" GOTO 2<br/>ECHO What Torrent Downloader are you using?<br/>ECHO 1: µTorrent<br/>ECHO 2: BitTorrent<br/>ECHO 3: Vuze<br/>ECHO 4: BitComet<br/>ECHO.<br/>ECHO If there is any other Client you are using, notify me<br/>ECHO and I'll add it to the list ;)<br/>ECHO.<br/>SET /P L=Type your desired number and press ENTER: <br/>IF %L%==1 SET TORRENT=%HOMEDRIVE%\Program Files\uTorrent\uTorrent.exe<br/>IF %L%==2 SET TORRENT=%HOMEDRIVE%\Program Files\BitTorrent\bittorrent.exe<br/>IF %L%==3 SET TORRENT=%HOMEDRIVE%\Program Files\Vuze\Azureus.exe<br/>IF %L%==4 SET TORRENT=%HOMEDRIVE%\Program Files\BitComet\bitcomet.exe<br/>---------------------<br/>--------------------- < Other part of the file, not necessary<br/>---------------------<br/>ECHO Start %TORRENT%?<br/>SET /P N=Type y [yes] or n [no], then press ENTER. <br/>IF %N%==y GOTO SBIT<br/>IF %N%==n GOTO FOX<br/>GOTO BIT<br/>:SBIT<br/>ECHO.<br/>Start "" /min "%TORRENT%"<br/>ECHO.<br/>ECHO %TORRENT% started minimized.<br/>Yeah so what I'm trying to do is making this "Save" file <em>somehow</em> lol<br/>Without it, this code is useless and I have to put the number each time I start the batch file... This is what I'm trying to avoid. Code: <a>[Select]</a>IF EXIST "" "Save" GOTO 2This is also not for one-time usage as you might understand. I'll also use this for other programs I want to start with this batch file and for future batch files also <br/><br/>I've also thought about doing IF EXIST but there is a possibility the user has multiple of these programs...<br/><br/>I really hope you guys can help <br/><br/>PS: Anyone has another torrent client I need to add? In a batch you can create a variable.<br/>If you do not release the variable, it lives forever.<br/><br/>As I dimly recall, there was a Broadway show ...<br/>where the programmer sang:<br/><br/> "In a clear Batch.....<br/> ..variables forever..."<br/><br/> Quote from: Geek-9pm on August 05, 2010, 10:21:47 AM</p><blockquote>In a batch you can create a variable.<br/>If you do not release the variable, it lives forever.<br/><br/>As I dimly recall, there was a Broadway show ...<br/>where the programmer sang:<br/><br/> "In a clear Batch.....<br/> ..variables forever..."<br/><br/><br/></blockquote> Can you put an <a href="https://interviewquestions.tuteehub.com/tag/example-239971" style="font-weight:bold;" target="_blank" title="Click to know more about EXAMPLE">EXAMPLE</a> please?<br/><br/>Thanks Code: <a>[Select]</a>:1<br/>IF EXIST TorrentClientChoice.txt (<br/> set /p L=<TorrentClientChoice.txt<br/> GOTO loaded<br/> )<br/>ECHO What Torrent Downloader are you using?<br/>ECHO 1: µTorrent<br/>ECHO 2: BitTorrent<br/>ECHO 3: Vuze<br/>ECHO 4: BitComet<br/>ECHO.<br/>ECHO If there is any other Client you are using, notify me<br/>ECHO and I'll add it to the list ;)<br/>ECHO.<br/>SET /P L=Type your desired number and press ENTER: <br/>>TorrentClientChoice.txt echo %L%<br/>echo Preference %L% saved<br/>:loaded<br/>IF %L%==1 SET TORRENT=%HOMEDRIVE%\Program Files\uTorrent\uTorrent.exe<br/>IF %L%==2 SET TORRENT=%HOMEDRIVE%\Program Files\BitTorrent\bittorrent.exe<br/>IF %L%==3 SET TORRENT=%HOMEDRIVE%\Program Files\Vuze\Azureus.exe<br/>IF %L%==4 SET TORRENT=%HOMEDRIVE%\Program Files\BitComet\bitcomet.exe<br/>---------------------<br/>--------------------- < Other part of the file, not necessary<br/>---------------------<br/>ECHO Start %TORRENT%?<br/>SET /P N=Type y [yes] or n [no], then press ENTER. <br/>IF %N%==y GOTO SBIT<br/>IF %N%==n GOTO FOX<br/>GOTO BIT<br/>:SBIT<br/>ECHO.<br/>Start "" /min "%TORRENT%"<br/>ECHO.<br/>ECHO %TORRENT% started minimized. Quote from: Ghosty on August 05, 2010, 10:24:34 AM<blockquote>Can you put an example please?<br/><br/>Thanks<br/></blockquote> <br/>He is joking.<br/> Quote from: Salmon Trout on August 05, 2010, 10:36:50 AM<blockquote>He is joking.<br/><br/></blockquote> Lol...<br/>No<br/>To be honest not xD<br/>I never learned this part of batch (until now)<br/>I'm sorry<br/><br/>And thanks a lot for helping <br/><br/>PS: what was the double post for? Quote from: Ghosty on August 05, 2010, 11:23:52 AM<blockquote>PS: what was the double post for?</blockquote> <br/>What double post?<br/> Quote from: Salmon Trout on August 05, 2010, 11:27:02 AM<blockquote>What double post?<br/><br/></blockquote> <br/>Lol<br/>First I asked for an example. Then you posted the code which helped me <br/>Then you posted that I was joking (which I wasn't) Quote from: Ghosty on August 05, 2010, 12:37:45 PM<blockquote> <br/>Lol<br/>First I asked for an example. Then you posted the code which helped me <br/>Then you posted that I was joking (which I wasn't)<br/></blockquote> <br/>Do you have trouble understanding how quoting works in forums? I'll try to put it simply for you.<br/><br/>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.)<br/>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 <em>is</em> funny.)<br/>3. I (Salmon Trout) quoted you (Ghosty) asking for an example, and wrote underneath that he (Geek-9pm) was joking.<br/><br/><br/><br/> Quote from: Salmon Trout on August 05, 2010, 12:55:34 PM<blockquote>Do you have trouble understanding how quoting works in forums? I'll try to put it simply for you.<br/><br/>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.)<br/>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 <em>is</em> funny.)<br/>3. I (Salmon Trout) quoted you (Ghosty) asking for an example, and wrote underneath that he (Geek-9pm) was joking.</blockquote> Lol...<br/>Oops<br/><br/>Oversaw that it was him and not you lol<br/>SORRY MY FAULT I <a href="https://interviewquestions.tuteehub.com/tag/went-734459" style="font-weight:bold;" target="_blank" title="Click to know more about WENT">WENT</a> through it too quickly<br/><br/>HOWEVER<br/>You DID double post <br/>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<blockquote>You DID double post </blockquote> <br/>You don't <a href="https://interviewquestions.tuteehub.com/tag/know-534065" style="font-weight:bold;" target="_blank" title="Click to know more about KNOW">KNOW</a> what "double posting" is. It is when somebody makes the same post twice, sometimes in the same <a href="https://interviewquestions.tuteehub.com/tag/thread-771901" style="font-weight:bold;" target="_blank" title="Click to know more about THREAD">THREAD</a>, 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. <br/><br/> Quote<blockquote>Your first post was "He is joking." The post after that you made was the code </blockquote> <br/>Actually, it was the other way around.<br/> Quote from: Salmon Trout on August 05, 2010, 01:19:33 PM<blockquote>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.</blockquote> <br/>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.<br/><br/><br/> Quote from: Salmon Trout on August 05, 2010, 01:19:33 PM<blockquote>Actually, it was the other way around.</blockquote> <br/> 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<blockquote>Maybe in the forums where you post, but not in mine.</blockquote> <br/>This is a "forum where I post", in case you hadn't noticed.<br/><br/><br/> Quote from: Salmon Trout on August 05, 2010, 01:29:36 PM<blockquote>This is a "forum where I post", in case you hadn't noticed.</blockquote> It would be dumb from me not to notice that you posted here.<br/>The point is that I'm used to the situation I wrote about the double post.<br/><br/>ANYWAY let's stop this crap this is entirely off-topic<br/><br/><br/>I assume that there's a way to make more than one command in a single line.<br/>For example Code: <a>[Select]</a>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<br/><br/> Code: <a>[Select]</a>if "%var%"=="egg" echo yolk & echo white</body></html> | |