Login Register






Batch. The Ultimate Tutorial. filter_list
Author
Message
RE: Batch. The Ultimate Tutorial. #11
(08-03-2011, 08:19 AM)chipp Wrote: yes, but where is it defined? is it in the do? and so that's mean that %%a is not the same a we've declared before right?

It's defined in the IN in the FOR command.
[Image: nNICR.jpg]
Creds to bluedog

For a list of my contributions (includes tutorials). Click here.

If you'd like to apply for Heat, please click here.

Reply

RE: Batch. The Ultimate Tutorial. #12
so what's this line means:
Code:
echo texttexttext>%%a
[Image: ap8g35.jpg]

Reply

RE: Batch. The Ultimate Tutorial. #13
(08-04-2011, 03:42 PM)chipp Wrote: so what's this line means:
Code:
echo texttexttext>%%a

It writes "texttexttext" to the file. The ">" means to write to a file. And the file being written to is the one being defined by "%%a" in the IN statement in the FOR command.
[Image: nNICR.jpg]
Creds to bluedog

For a list of my contributions (includes tutorials). Click here.

If you'd like to apply for Heat, please click here.

Reply

RE: Batch. The Ultimate Tutorial. #14
oh, so it's like "for each" in C#, am i right?
[Image: ap8g35.jpg]

Reply

RE: Batch. The Ultimate Tutorial. #15
(08-05-2011, 05:23 AM)chipp Wrote: oh, so it's like "for each" in C#, am i right?

Something like that, yes. But Batch isn't close to being as powerful as C#.
[Image: nNICR.jpg]
Creds to bluedog

For a list of my contributions (includes tutorials). Click here.

If you'd like to apply for Heat, please click here.

Reply

RE: Batch. The Ultimate Tutorial. #16
btw, how to increase a variable's value? i tried this but it doesn't work...
Code:
@echo off set a=1 : go echo this will printed on your screen for %a% times a=a+1 goto go pause
[Image: ap8g35.jpg]

Reply

RE: Batch. The Ultimate Tutorial. #17
(08-20-2011, 06:00 AM)chipp Wrote: btw, how to increase a variable's value? i tried this but it doesn't work...
Code:
@echo off set a=1 : go echo this will printed on your screen for %a% times a=a+1 goto go pause

Get rid of the space after the line label.
[Image: nNICR.jpg]
Creds to bluedog

For a list of my contributions (includes tutorials). Click here.

If you'd like to apply for Heat, please click here.

Reply

RE: Batch. The Ultimate Tutorial. #18
i guess it's just the same, i tried this code and not working too...
Code:
@echo off set a=1 set b=1 :go echo this will printed on your screen for %a% times set a=%a%+%b% goto go pause
[Image: ap8g35.jpg]

Reply

RE: Batch. The Ultimate Tutorial. #19
Code:
@echo off :question echo What's 1+1? set /p input= if '%input%' = '2' goto correct if not '%input%' = '2' goto false :correct cls echo Good job! pause :false echo You are one dumbass. echo Try again echo. goto question

Is there some bug in the code ... because it gives "-unexpected end of file" and closes instantly whatever the value of "input" maybe...


(08-21-2011, 08:22 AM)chipp Wrote: i guess it's just the same, i tried this code and not working too...
Code:
@echo off set a=1 set b=1 :go echo this will printed on your screen for %a% times set a=%a%+%b% goto go pause


try this chipp :
Code:
@echo off set a=1 set b=1 :go echo this will printed on your screen for %a% times set a=%a%+%b% pause goto go



but still it does not giv the value .. it extends as 1+1+1+1....


O.OO.O

Reply

RE: Batch. The Ultimate Tutorial. #20
btw, i tried to do something like this:

Code:
@echo off diskpart select volume 4 remove letter m list volume

but it doesn't work, can anybody tell me how? it's the same with my effort to runas command

Code:
runas /user:user_one program.exe password

the result is nothing... -_-!

HELP...!

@zabra: it is treated as string so i guess the problem with the initialation, maybe it should convert to int when it is initialized.
[Image: ap8g35.jpg]

Reply