Batch Files

Questions about programming languages and debugging
Post Reply
User avatar
snapson
forum buddy
forum buddy
Posts: 18
Joined: 30 Aug 2006, 16:00
18

Batch Files

Post by snapson »

I know some basics about batch files but not much could somebody explain some of the commands to me and tell me how to write a script that would continuously open new command windows until the computer crashes to test the cpu strength

thanx

User avatar
Gogeta70
^_^
^_^
Posts: 3275
Joined: 25 Jun 2005, 16:00
19

Post by Gogeta70 »

Heh, not hard. I used to make batch files all the time. Batch files are basically cmd commands in a file.

Code: Select all

@echo off

:loop
start cmd
goto loop
A batch file can be stopped using Ctrl+C.
¯\_(ツ)_/¯ It works on my machine...

User avatar
floodhound2
∑lectronic counselor
∑lectronic counselor
Posts: 2117
Joined: 03 Sep 2006, 16:00
18
Location: 127.0.0.1
Contact:

Post by floodhound2 »

Nice code I never consider it this way. Course I don’t code batch file much. This thing ran the hell out of my PC. Nice job

Got any other types of code for batch? I am interested can I count

Code: Select all

For x = 1 to 100 
	Of x = 50 then exit
Next 
Can something like this work?

Peace
₣£ΘΘĐĦΘŮŇĐ

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11639
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

FOR-loops work, only the syntax is a little different, here's a command reference:

http://www.ss64.com/nt/

:wink:

User avatar
snapson
forum buddy
forum buddy
Posts: 18
Joined: 30 Aug 2006, 16:00
18

thnx

Post by snapson »

hey thanks one more question in there anyway that i can make a file that copies another one into the startup directory or someother place??

User avatar
Nerdz
The Architect
The Architect
Posts: 1127
Joined: 15 Jun 2005, 16:00
19
Location: #db_error in: select usr.location from sucko_member where usr.id=63;
Contact:

Post by Nerdz »

Virus Alert! :twisted:
Give a man a fish, you feed him for one day.
Learn a man to fish, you feed him for life.

User avatar
floodhound2
∑lectronic counselor
∑lectronic counselor
Posts: 2117
Joined: 03 Sep 2006, 16:00
18
Location: 127.0.0.1
Contact:

Post by floodhound2 »

I am sure it can be done look at the link bad_brain left and from the code you have I figure you can accomplish it simply. I will see if I can manage to get it working on my pc and report in later.

PEACE
₣£ΘΘĐĦΘŮŇĐ

User avatar
snapson
forum buddy
forum buddy
Posts: 18
Joined: 30 Aug 2006, 16:00
18

More questions

Post by snapson »

im trying to get a batch file to create a new batch file but it keeps saying that the syntax is incorrect the same happens when i try to copy a file from the current directory to another one its says syntax is incorrect. could somebady explain the syntax with copy and also how to make a batch file that creates another

thanks

User avatar
floodhound2
∑lectronic counselor
∑lectronic counselor
Posts: 2117
Joined: 03 Sep 2006, 16:00
18
Location: 127.0.0.1
Contact:

Post by floodhound2 »

try something like this

Code: Select all


@echo off 

:loop 
start cmd
xcopy looper
looper

exit
this i was unable to stop from copying until i turned off my PC.
PEACE
₣£ΘΘĐĦΘŮŇĐ

User avatar
floodhound2
∑lectronic counselor
∑lectronic counselor
Posts: 2117
Joined: 03 Sep 2006, 16:00
18
Location: 127.0.0.1
Contact:

Post by floodhound2 »

Oh i forgot to say i named my original batach file looper.bat
₣£ΘΘĐĦΘŮŇĐ

User avatar
snapson
forum buddy
forum buddy
Posts: 18
Joined: 30 Aug 2006, 16:00
18

??

Post by snapson »

what does xcopy do? does it just keep copying the file randomly? how can i copy a file to a specific destination also if anybody has any ideas on how to make a batch file that make a batch file please email me at logger981@hotmail.com

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11639
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

have you even looked at the link I posted?
Syntax
XCOPY source [destination] [options]

Key
source : Pathname for the file(s) to be copied.

destination : Pathname for the new file(s).

User avatar
floodhound2
∑lectronic counselor
∑lectronic counselor
Posts: 2117
Joined: 03 Sep 2006, 16:00
18
Location: 127.0.0.1
Contact:

Post by floodhound2 »

Look if you pay me I will do what you desire. Otherwise please do some homework. Man people have become so lazy and want to have things done for them. Bad_brain did leave a great post try and follow the info there or PAY ME…..


Just kiddin

PEACE
₣£ΘΘĐĦΘŮŇĐ

User avatar
snapson
forum buddy
forum buddy
Posts: 18
Joined: 30 Aug 2006, 16:00
18

...

Post by snapson »

yea well thanks bad brain but fcuk u floodhound pay me what an idiot its like 10 lines of code you lazy shit

User avatar
Gogeta70
^_^
^_^
Posts: 3275
Joined: 25 Jun 2005, 16:00
19

Post by Gogeta70 »

Hey, no need for that. Floodhound was kidding, no need to jump his ass.
¯\_(ツ)_/¯ It works on my machine...

Post Reply