This is second instructable .. so still go easy on me .. ty

This script is a loading script .. well it only looks like one , it doesn't actually load anything .. its if you just want the effect of something in a batch file to seem like it is loading ...
I will give you the script and i will show you how i did it ...
please leave a comment about what you thought ... Thanks

Also because of how awesome El Mano is =P
somewhere on the comments he has posted a better version of this..
Thanks El Mano =D .. saves me the work of posting it.

Step 1: Steal My Script

OK if you can't be bothered to see how it works then you can just steal my script . I attached it . so you will have to delete one of the 'b's off the file extension for it to be readable.. and you will have to edit what it says at the top of the script .. and remove the 'By iRule' at the bottom of the script.. if something doesn't work please pm me or leave a comment...
<p>Thanks Now I used it for my OS :)</p>
<p>Similar to the one El Mano posted, but with the percentage in the progress bar. Where it says &lt;40 spaces&gt; you need to add 40 spaces, because these comments strip them out:</p><p>@echo off</p><p>color 0A</p><p>set &quot;progbar= &lt;40 spaces&gt;&quot;</p><p>set /a pct=0</p><p>:top</p><p>cls</p><p>echo(</p><p>echo Loading... </p><p>echo ---------------------------------------------</p><p>echo %progbar% %pct%%%</p><p>echo ---------------------------------------------</p><p>ping localhost -n 2 &gt; nul</p><p>set progbar=[]%progbar:~0,-2%</p><p>if %pct%==100 goto end</p><p>set /a pct=%pct%+5</p><p>goto top</p><p>:end</p><p>echo Done^^!!</p><p>pause</p>
<p>You could use a for loop or just make a variable (that is the percentage of what is loaded already) and increase it by 5 and check to see if it is at 100. When it reaches 100, then the loop stops and goes to whatever it needs to do.</p><p>Example: </p><p>echo off</p><p>color 0A</p><p>mode 300</p><p>::/\ You don't have to put this line in</p><p>cls</p><p>set /a &quot;percent=0&quot;</p><p>set /a &quot;loaded=&quot;</p><p>:A</p><p>echo Loading... Please wait</p><p>echo ---------------------------------------</p><p>echo %loaded% = %percent%% ]</p><p>echo ---------------------------------------</p><p>set /a &quot;percent=%percent%+5&quot;</p><p>set /a &quot;loaded=%loaded%+'|'&quot;</p><p>:B</p><p>::Whatever you need to do after it loads...</p><p>You get the idea, right? This isn't perfect. Don't copy it into your editor and run it because the program doesn't work, but the idea does.</p>
I think that this is pointless in a actual batch program where you want to get something done. But, It would be good in a batch movie. If I were going to put a loading command, then I would actually make the loading screen real. For instance, It would only show for the amount of time to load, with you can do with the call command.
<p>It would be useful if you were making a script for a customer who isn't really tech savvy and you wanted to show the progress so that he/she doesn't think the program has stalled. In example a backup script where each 10% takes about, say, three minutes.</p>
cheers I think ? ... i know it would be pretty pointless in an actual script but i thought that might come useful to someone like someone making a movie
<p>Why do you use the ping command? You better use the timeout command</p><p>timeout -t 2 &gt;NUL</p>
<p>Because the timeout command (after what I've read) doesn't really do things in exactly the amount of seconds it's supposed to do. Many will swear to to using ping as well because it uses less processor power (hardly an issue today). In the end it really doesn't matter; use whatever works!</p>
<p>How to you do like 1.5 or something less than 2 and more than 1</p>
This is a cool program, but it takes up a lot of space, making your file large and hard-to-edit. This is a much shorter, if more complicated, way:<br/><br/>@echo off<br/>title Loading... By El Mano<br/>color 0a<br/>set load=<br/>set/a loadnum=0<br/>:Loading<br/>set load=%load%()<br/>cls<br/>echo.<br/>echo Loading... Please Wait...<br/>echo ----------------------------------------<br/>echo %load% <br/>echo ----------------------------------------<br/>ping localhost -n 2 &gt;nul<br/>set/a loadnum=%loadnum% +1<br/>if %loadnum%==20 goto Done<br/>rem You can set the number of ()'s as whatever you rem want but remember: in your &quot;loading box&quot; you rem need 2 spaces for every () because &quot;()&quot; takes up rem 2 spaces. The above box has 40 spaces, so rem twenty repeats, adding 1 () every repeat.<br/>goto Loading<br/>:Done<br/>echo.<br/>pause<br/>rem *your action here*<br/>exit<br/><br/>Feel free to modify, use, or ignore this. It's not copyrighted.<br/>
Wow dude thx for this
Hi i know this was all the way back in 2009 but I was wondering if you could explain this a little bit i dont understand the <br>&quot; set load=%load%&quot;<br>why not just<br>&quot;set load=()&quot;?
This script works by making a line of ()'s across the screen. Each time it loops, it adds a () to the echoed script, so the first time it loops it echoes &quot;(),&quot; then second time &quot;()()&quot;, the third time &quot;()()()&quot;, and so on. <br> <br>Set load=%load%() <br> <br>takes what %load% already contains, a number of ()'s, and adds another () to the end of the line, so that with each loop the screen echoes one more ().
yeah thankyou for commenting so quickly i was looking at it at realizit it was kinda like <br>%number%+1 <br>but for a variable very cool thank you ^.^
nice script
yer i know it is a very long script and i know you can do it that way but i posted this when i was still not very good with batch so i did it the long way
this would be cool for a fake virus.....something like:....i also found a bit of an error...right around the 50% mark to 70% or so, the please wait is in different positions, so i changed it and it looks right...(maybe not)....i also deleted all the echo. 's...all it does it add size....unless u made it that way for a reason....
haha, I did the same thing! except, after it &quot;deletes&quot; everything it runs a blue screen of death on you!
sorry about using this comment to ask this but, if i added shutdown -s -t 10 -c "good-bye." would it still work?
it would still work , but yod have to add it to towards the bottom like so: echo RAM failure echo contact local computer repair and report ID ten T error shutdown -s -t 10 -c "good-bye."
yerp....any other questions and i'd gladly help...
I added some echo's at the beginning so it would be in the centre..left centre
um...k...do u like my little version of urs?
lol your virus version is really good :]
rlly?it was a quick 5 min throw together...i have 2 questions.....1:would you like to colborate with my little instructable on batch? and 2: i am trying to make a password vault...but im not sure a couple bits...ill send you a scan of the rough draft as soon as my scaner works....ty
ok sure .. and kk ty ..lol
i also found that at 96% and 100% the bars are at the same place....ill work on that and post an update for you as soon as i get home....
Has everyone forgot the <a rel="nofollow" href="http://www.ss64.com/nt/sleep.html">sleep command</a>?<br/>
yes because you need the external exe for that this way you only need 1 file for your batch
sweet i edited it but its great thanx for all ps ho w do you add a download link
download link? you meen o download file off web? ... And do you meen auto done after loading thing or do you want th press button to download?
omg great! i have it set up so at the end it opens another batch file! its great to fool people. im going to use the same idea to make a batch stop motion animation movie someday
go here ( my site ) : <a rel="nofollow" href="http://irule-scripts.awardspace.com/Scripts/index.php?id=LEIB&T=bat">link</a> <br/>its a better version of this and uses less space =]<br/>
Thanks, it is better, but i sort of like this version because it takes longer.
i combined this with keyboard led loader (vbs) <a href="http://www.instructables.com/id/keyboard_led_loader/">http://www.instructables.com/id/keyboard_led_loader/</a> <br/>-code-<br/>ping localhost -n 2 &gt;nul<br/>rem call keyboard led loader<br/>start twinkle.vbs<br/>cls<br/>echo.<br/>-/code-<br/>then actually called a program<br/>-code-<br/>echo.<br/>echo.<br/>echo ***************************************<br/>echo ************* Thanks For **************<br/>echo **************** Your *****************<br/>echo **************** Time *****************<br/>echo ***************************************<br/><br/>pause &gt;nul<br/><br/>start C:\Program Files\Gamescampus\xiah\xiah.exe<br/>-/code-<br/><br/>then used bat to exe to put it all into one file added the xiah icon and sent it to my friends who play this game all the time<br/>
cool looks good
WOW, even though it's lot really a loading bar, you can make it seem like it, that's so cool! Thanks so much!
lol cheers .. you could actually make it load something if you add in bits of your code at each section of the script ;)
Yeah, I thought so, like starting components to an exe file in the background (hidden) and then open the exe file once the file is complete.
Very nice Instructable. I like the idea, i might use that in a project of mine, maybe in a text/batch movie.....:D thanks again keep it up
ty .. n id like to see ur finished movie thing when its done :D
lol, now i have a reason to finish it :D ill get it to ya ASAP now

About This Instructable


12 favorites


More by iRule: Screen Lock (VB.NET) VBS Tutorial - Basics Batch Maker
Tags: Loading batch bat
Add instructable to: