![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| 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: * 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 |
|
|||||||
| Other Hardware Support Support forum for other hardware; Mice, keyboards, PDAs |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#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.
|
|
|
|
| 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 |
|
|
#2 (permalink) |
|
TSF Enthusiast
|
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 Code:
@echo off REN *.* *.000 DEL *.bat
__________________
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!
|
|
|
|
|
|
#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.
|
|
|
|
|
|
#4 (permalink) |
|
Asst. Manager, Automotive Forums; HJT Trainee
Join Date: Jan 2003
Location: Behind you, watching you as you type.
Posts: 7,372
OS: Click "My System" to view details
|
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 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> |
|
|
|
|
|
#5 (permalink) |
|
TSF Enthusiast
|
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!
|
|
|
|
|
|
#6 (permalink) |
|
TSF Enthusiast
|
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. |
|
|
|
|
|
#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... |
|
|
|
|
|
#9 (permalink) | |
|
TSF Enthusiast
|
Quote:
|
|
|
|
|
|
|
#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. |
|
|
|
|
|
#11 (permalink) |
|
Asst. Manager, Automotive Forums; HJT Trainee
Join Date: Jan 2003
Location: Behind you, watching you as you type.
Posts: 7,372
OS: Click "My System" to view details
|
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 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. |
|
|
|
|
|
#12 (permalink) | ||
|
Asst. Manager, Automotive Forums; HJT Trainee
Join Date: Jan 2003
Location: Behind you, watching you as you type.
Posts: 7,372
OS: Click "My System" to view details
|
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:
Quote:
also, don't feel bad about it, we've ALL done things exactly like this, it's called learning.
__________________
<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. |
||
|
|
|
|
|
#13 (permalink) |
|
TSF Enthusiast
|
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. |
|
|
|
|
|
#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.
|
|
|
|
|
|
#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.
|
|
|
|
|
|
#17 (permalink) |
|
TSF Enthusiast
|
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!
|
|
|
|
|
|
#18 (permalink) |
|
Moderator Hardware Team
|
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 |
|
|
|
|
|
#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.
|
|
|
|
|
|
#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) |
|
|
|
![]() |
| Thread Tools | |
|
|