Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Hardware Support > Other Hardware Support
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Other Hardware Support Support forum for other hardware; Mice, keyboards, PDAs

Reply
 
LinkBack Thread Tools
Old 08-20-2006, 09:21 PM   #1 (permalink)
Registered User
 
Join Date: Aug 2006
Posts: 320
OS: XP Pro, Vista Business, Suse Linux, Win98 SE


Noob (of all noobs) terminology

I know this question is dumb. I know I will get many, and I mean many laughs out of this question but... anyway, I was wondering what exactly a batch file does, or how to creat a simple one? Please dont give me a definition online because I've been on google for an hour now. "A batch file is a series of commands that you might ordinarily issue at the system prompt in order to perform a computer operation. The most common uses are to start programs and to run utilities"... Well I get that definition but could i get a good noobish example. Or even a good example (details) on how to make one or run one. If you could give detailed examples that would be great. I've been to numerous sites so it really doesn't help unless its very very detailed. I'm starting from the ground up here (more like under the ground with this question) and I need some help. Thanks and sorry for the stupid question.
tech-it-^ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 08-20-2006, 09:31 PM   #2 (permalink)
Fox
TSF Enthusiast
 
Fox's Avatar
 
Join Date: Sep 2002
Location: NJ
Posts: 7,752
OS: XP Pro, CentOS

My System

Send a message via ICQ to Fox Send a message via AIM to Fox Send a message via MSN to Fox Send a message via Yahoo to Fox Send a message via Skype™ to Fox
Basically it allows you to create a sort of 'recipe' of DOS commands that take place in sequence, and then be able to call up that recipe as if it were a program on your computer.

They can be made in several ways, but the easiest way I've found is to create a text file, type out the commands (one per line), and then save the file with the extension .bat.

For example, if I wanted to make a batch file that would rename every file in the folder it's executed in to have the extension .000, it would look something like this:

Code:
REN *.* *.000
if I wanted to do the same thing and not have anything show up on the screen while it's doing what it's doing, and then have it delete itself, it would look like this:

Code:
@echo off
REN *.* *.000
DEL *.bat
Be careful with batch files. They're not flagged by most Antivirus programs because they are used predominently as a tool, which is what they're meant for. But when you ask them to, they shoot to kill, and they don't warn you in advance unless you use a wildcard (*) for both the filename and extension. Suffice it to say, the files don't just go to the recycle bin- they go away, unless you have one of those fancy file recovery programs.
__________________
Antec Neo Power 500W, ABIT IP35-E, Intel E2180@2.66Ghz, Corsair XMS2 2x1GB DDR2-800, PNY 8800GT, 320GB Seagate

* lazy college student alert *- If I've inadvertently ignored a thread, please Let me know about it

Have I helped you solve your problem?
Donate to Techsupportforums

Klart Skepp!
Fox is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-21-2006, 04:00 AM   #3 (permalink)
Registered User
 
Join Date: Aug 2006
Posts: 320
OS: XP Pro, Vista Business, Suse Linux, Win98 SE


alright, well that makes it a little more clear for me. Thank you very much for responding. Though when you say "rename every file in the folder it's executed in to have the extension .000", how do you specify what folder? What is .000? Sorry, I know you put it in simple terms for me but it is still kind of foggy. Though for the most part it really helped me out. Thank you! Would you happen to be able to explain it a little more? Sorry, but I really appreciate it.
tech-it-^ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-21-2006, 06:29 AM   #4 (permalink)
Asst. Manager, Automotive Forums; HJT Trainee
 
Volt-Schwibe's Avatar
 
Join Date: Jan 2003
Location: Behind you, watching you as you type.
Posts: 7,372
OS: Click "My System" to view details

My System

i can sorta clear up what he was meaning.

lets say, i have a huge folder full of txt files, and for some reason, i want them to all have .000 as the extension. (.000 is simply another extension, which could be associated later.)

let's say i wanted them to be .BAK, so i know they are backups...

i'd use the same batch file, but it would be
Code:
REN *.* *.BAK
the way you tell it which folder, in that case, is by putting the batch file inside the folder.

think of it this way. when you sit down at a dos command prompt, you type some commands to make things happen. you can stick those same files into a notepad file, and save them as .bat, and they are now a simple program.

i say program, but it's only barely a program.

if you wish to know what commands a batch file can process, i suggest reading about "dos commands" since a batch file is simply a series of dos commands turned into it's own script.

they have specific uses, but i have to admit, even in this day and age of windows xp, i use them at least once a week.
__________________
<signature>

TSF is funded by our Admin's pocket, care to help?
Power Tip: Subscribe to your thread (Thread Tools) to receive an instant email notification when you get a reply.
New Members: Creating a single new thread in the correct section is the best way to assure your thread will receive a reply.
</signature>
Volt-Schwibe is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-21-2006, 12:32 PM   #5 (permalink)
Fox
TSF Enthusiast
 
Fox's Avatar
 
Join Date: Sep 2002
Location: NJ
Posts: 7,752
OS: XP Pro, CentOS

My System

Send a message via ICQ to Fox Send a message via AIM to Fox Send a message via MSN to Fox Send a message via Yahoo to Fox Send a message via Skype™ to Fox
I actually used the sweeping extension rename to salvage a ton of pictures when my bro started freaking after downloading a variation of the loveletter virus. I just stuck it in the folder with all the pictures, ran it, and they were renamed and protected.
__________________
Antec Neo Power 500W, ABIT IP35-E, Intel E2180@2.66Ghz, Corsair XMS2 2x1GB DDR2-800, PNY 8800GT, 320GB Seagate

* lazy college student alert *- If I've inadvertently ignored a thread, please Let me know about it

Have I helped you solve your problem?
Donate to Techsupportforums

Klart Skepp!
Fox is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-21-2006, 03:04 PM   #6 (permalink)
TSF Enthusiast
 
jnob's Avatar
 
Join Date: Nov 2005
Location: CA Valley
Posts: 692
OS: XP Pro, SP2

My System

Another good way to gain some experience with dos commands is to open up a DOS prompt and type help. It will give you a list of DOS commands and a brief description of their function. From there if you want to find out more about the command you can just type it's name followed by /?. For example, if you wanted to know more about the attrib command you would just type attrib /? at the command prompt.

You can make batch files on the spot by typing edit batchname.bat, enter the commands here and save when exiting. So if you decided you want to set all the files in a folder to read-only so they can't be edited you can type:

c:\>edit makeRO.bat

then add the lines:

@ECHO OFF <if you don't want to see the files being converted>
attrib +R *.*

Then go to the file drop down menu (ALT+F) click exit (ALT+X) and click yes when it asks you if you want to save, now you have a batch file named makeRO that will make all the files in a folder read only.
__________________
Everest
Memtest86
jnob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-21-2006, 03:55 PM   #7 (permalink)
Registered User
 
Join Date: Aug 2006
Posts: 320
OS: XP Pro, Vista Business, Suse Linux, Win98 SE


thanks guys, I really appreciate it. It helps me out a lot. Sorry again for the dumb question.
tech-it-^ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-21-2006, 04:11 PM   #8 (permalink)
Registered User
 
Join Date: Aug 2006
Posts: 320
OS: XP Pro, Vista Business, Suse Linux, Win98 SE


alright i tried to test the rename and it didnt work out to good.
I typed this for the batch

first went to edit testit.bat

then in blue i put REN *.**.BAK
then: dir c:\documents and settings\batchtest

The batchtest is where i put some .txt documents and wanted to convert them BAK. am I suppose to put something in place of those * ? Did I put a space in or somthing or what? Sorry, it didnt work out for me...
tech-it-^ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-21-2006, 04:14 PM   #9 (permalink)
TSF Enthusiast
 
jnob's Avatar
 
Join Date: Nov 2005
Location: CA Valley
Posts: 692
OS: XP Pro, SP2

My System

Quote:
Originally Posted by tech-it-^
alright i tried to test the rename and it didnt work out to good.
I typed this for the batch

first went to edit testit.bat

then in blue i put REN *.**.BAK
then: dir c:\documents and settings\batchtest

The batchtest is where i put some .txt documents and wanted to convert them BAK. am I suppose to put something in place of those * ? Did I put a space in or somthing or what? Sorry, it didnt work out for me...
You need a space between the files you are changing and what you are changing them to: REN *.*<space>*.bak
__________________
Everest
Memtest86
jnob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-21-2006, 08:16 PM   #10 (permalink)
Registered User
 
Join Date: Aug 2006
Posts: 320
OS: XP Pro, Vista Business, Suse Linux, Win98 SE


ok, well I type in this exactly

C:\edit test.bat

REN *.* *.bak
dir c:\documents and settings\bob\testbatch

<exit and save>

c:\ test
c:\ REN *.* *.bak
a duplicate file name exists, or the file cannot be found
a duplicate file name exists, or the file cannot be found
a duplicate file name exists, or the file cannot be found

C:\ dir c:\documents and settings\bob\testbatch
the system cannot find the file specified


ok...now i have those txt files in testbatch folder in that directory. Whats up? I don't get it but it makes the files in my local C:\ as .bak extensions... and it isnt the cd\ directory either. I tried both. doesnt work. What am i typing wrong. The files in the "testbatch" folder are simple .txt files from notepad and I just want to rename them to bak. What am I doing wrong and what is making the rename go to the C:\ directory? Sorry to be so frusterating, but I am going crazy! Sorry, once again.

Last edited by tech-it-^; 08-21-2006 at 08:20 PM.
tech-it-^ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-22-2006, 07:15 AM   #11 (permalink)
Asst. Manager, Automotive Forums; HJT Trainee
 
Volt-Schwibe's Avatar
 
Join Date: Jan 2003
Location: Behind you, watching you as you type.
Posts: 7,372
OS: Click "My System" to view details

My System

ok, i am not sure what happened along the way, but here is what i did...

i created a new folder, named testtest

i put 20 txt files in it.

i put this one single line
Code:
REN *.* *.BAK
into a new text document, and saved it as test.bat inside that same folder

i then crossed my fingers, and double clicked it.

instantly, all 20 txt files in that folder only changed from .txt to .bak.

even the batch file itself changed.

so, i have no idea what isn't right, perhaps you ran it from c: somehow, instead of inside that folder as was mentioned.
__________________
<signature>

TSF is funded by our Admin's pocket, care to help?
Power Tip: Subscribe to your thread (Thread Tools) to receive an instant email notification when you get a reply.
New Members: Creating a single new thread in the correct section is the best way to assure your thread will receive a reply.
</signature>

Last edited by Volt-Schwibe; 08-22-2006 at 07:17 AM.
Volt-Schwibe is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-22-2006, 07:22 AM   #12 (permalink)
Asst. Manager, Automotive Forums; HJT Trainee
 
Volt-Schwibe's Avatar
 
Join Date: Jan 2003
Location: Behind you, watching you as you type.
Posts: 7,372
OS: Click "My System" to view details

My System

ok, a picture is worth 1000 words, and 2 pictures is worth 2000....

here is two pics, one is before i clicked it, and the other is after.

seriously, there's not a simple explaination for what happened to you, that is, if you ran the batch file from inside the test folder.

to quote myself from earlier,

Quote:
Originally Posted by Volt-Schwibe
the way you tell it which folder, in that case, is by putting the batch file inside the folder.
and to quote fox,
Quote:
Originally Posted by Fox
if I wanted to make a batch file that would rename every file in the folder it's executed in to have the extension .000, it would look something like this:
as far as the actual problem at hand, which files exactly were renamed? you are going to need to rename them back to what they were, or things might not go too well when you reboot.

also, don't feel bad about it, we've ALL done things exactly like this, it's called learning.
Attached Images
File Type: jpg aaa.jpg (56.8 KB, 8 views)
File Type: jpg bbb.jpg (64.4 KB, 7 views)
__________________
<signature>

TSF is funded by our Admin's pocket, care to help?
Power Tip: Subscribe to your thread (Thread Tools) to receive an instant email notification when you get a reply.
New Members: Creating a single new thread in the correct section is the best way to assure your thread will receive a reply.
</signature>

Last edited by Volt-Schwibe; 08-22-2006 at 07:36 AM.
Volt-Schwibe is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-22-2006, 11:31 AM   #13 (permalink)
TSF Enthusiast
 
jnob's Avatar
 
Join Date: Nov 2005
Location: CA Valley
Posts: 692
OS: XP Pro, SP2

My System

You must execute the batch file within the folder you wish to change the files. So the test.bat file would have to be in the test folder to change those files. If you want to execute the file from anywhere you have two options one would be to specify the directory like this:

ren "c:\documents and settings\bob\testbatch\*.*" *.bak


or to make the batch file navigate to the directory:

cd\
cd "documents and settings\bob\testbatch"
ren *.* *.bak


Now if you only want to change certain files like .txt and not the .bat file you would have to specify ren *.txt *.bak. * just means any amount of characters in any order.
__________________
Everest
Memtest86
jnob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-22-2006, 04:32 PM   #14 (permalink)
Registered User
 
Join Date: Aug 2006
Posts: 320
OS: XP Pro, Vista Business, Suse Linux, Win98 SE


man, ya know what? You guys rock. I got it now i think. Pretty nice, though I don't know when I will need to do this. Thanks again for being so patient with me. I really appreciate it.
tech-it-^ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-22-2006, 05:24 PM   #15 (permalink)
TSF Enthusiast
 
jnob's Avatar
 
Join Date: Nov 2005
Location: CA Valley
Posts: 692
OS: XP Pro, SP2

My System

No problem! Always glad to help. Hope you come back often.
__________________
Everest
Memtest86
jnob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-24-2006, 06:25 PM   #16 (permalink)
Registered User
 
Join Date: Aug 2006
Posts: 320
OS: XP Pro, Vista Business, Suse Linux, Win98 SE


Alright, so I'm at work and this person calls me. They say that they have downloaded this program for their work and when they download it - it is a zip. So they unzip it and all it is-is a batch file. Now they run it and the DOS prompt comes up. After it's done it says hit any key to continue. After hitting a key it exits. Now... they couldn't find the program. I felt dumb because I'm suppose to know where it is. Though it's not in there all programs or in the unziped folder. Now is there some kind of DOS command that needs to be implemented in order to set the batch file to the correct directory to install? If so, how and what commands would I execute to do this? Sorry about this, and thanks.
tech-it-^ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-24-2006, 06:34 PM   #17 (permalink)
Fox
TSF Enthusiast
 
Fox's Avatar
 
Join Date: Sep 2002
Location: NJ
Posts: 7,752
OS: XP Pro, CentOS

My System

Send a message via ICQ to Fox Send a message via AIM to Fox Send a message via MSN to Fox Send a message via Yahoo to Fox Send a message via Skype™ to Fox
Does this person still have the batch file? If so, you could easily find out what it did by opening it up in notepad and looking through the commands that it had the computer execute.
__________________
Antec Neo Power 500W, ABIT IP35-E, Intel E2180@2.66Ghz, Corsair XMS2 2x1GB DDR2-800, PNY 8800GT, 320GB Seagate

* lazy college student alert *- If I've inadvertently ignored a thread, please Let me know about it

Have I helped you solve your problem?
Donate to Techsupportforums

Klart Skepp!
Fox is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-24-2006, 06:39 PM   #18 (permalink)
Moderator Hardware Team
 
koala's Avatar
 
Join Date: Mar 2005
Location: UK
Posts: 12,403
OS: XP/7/Ubuntu

My System

It's possible that the batch file deleted itself after running. Do you know what it was for and where he got it from?
__________________

New members: Subscribe to your thread (Thread Tools) to
receive an instant email notification when you get a reply.

TSF Folding@Home Team 85015 - details here
koala is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-24-2006, 07:55 PM   #19 (permalink)
Registered User
 
Join Date: Aug 2006
Posts: 320
OS: XP Pro, Vista Business, Suse Linux, Win98 SE


This program is a program specificly for work. For Ford. The person told me that they figured it out with someones help. They had to run the batch file and send the files to a different directory on a network? They used DOS cmds to set it up. I really need to find out more. I don't really get it, I thought maybe you guys would. I thought that after running the batch all the commands would already be executed and the program would then be ready, right? I don't know, I'm still very new to this stuff. thanks for the responses.
tech-it-^ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 08-25-2006, 12:07 AM   #20 (permalink)
TSF Enthusiast
 
Join Date: Oct 2004
Posts: 1,283
OS: windows XP Pro


ive been on other forums and if u post something like that on other forums they will laugh

but not here ^^

thats one of the reasons ive stayed in this forum for a very long time

(yes! a very long time compared to other forums ive registered to)
toxict3arz is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 01:19 AM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85