Scripts must be written in command line format, similar to writing a batch file or shell script. Note that only the last line of the script may be interactive; you cannot prompt for input in the middle of the script.
Want to create a batch file? It's easy.
Batch files are the computer handyman's way of getting things done. They can automate everyday tasks, shorten the required time to do something, and translate a complex process into something anyone could operate.
In this article, you'll learn how to write a simple batch file. You'll learn the basics of what batch files can do and how to write them yourself. I'll also provide you with further resources for learning to write batch (BAT) files.
How to Create a Batch File in Windows
Before going into the details, here is a quick summary
- Open a text file, such as a Notepad or WordPad document.
- Add your commands, starting with @echo [off], followed by—each in a new line—title [title of your batch script], echo [first line], and pause.
- Save your file with the file extension .bat, for example, test.bat.
- To run your batch file, double click the BAT file you just created.
- To edit your batch file, right-click the BAT file and select Edit.
Your raw file will look something like this:
And here's the corresponding command window for the example above:
If this was too quick or if you want to learn more about commands and how to use them, read on!
Step 1: Create a BAT File
Let's say that you frequently have network issues; you constantly find yourself on the command promptThe Best Command Prompt Tricks and TipsThe Best Command Prompt Tricks and TipsCommand Prompt is a great tool for everyday PC users because it's easy to use, yet powerful. Here are 15 Command Prompt tricks and tips you may have missed.Read More, typing in ipconfig and pinging Google to troubleshoot network problems. After a while, you realize that it would be a bit more efficient if you just wrote a simple BAT file, stuck it on your USB stick, and used it on the machines you troubleshoot.
Create a New Text Document
A batch file simplifies repeatable computer tasks using the Windows command prompt. Below is an example of a batch file responsible for displaying some text in your command prompt. Create a new BAT file by right-clicking an empty space within a directory and selecting New, then Text Document.
Add Code
Double-click this New Text Document to open your default text editor. Copy and paste the following code into your text entry.
Save As BAT File
The above script echoes back the text 'Welcome to batch scripting!'. Save your file by heading to File, Save As, and then name your file what you'd like. End your file name with the added .bat extension — welcome.bat for example — and click OK. This will finalize the batch process. Now, double-click on your newly created batch file to activate it.
Don't assume that's all batch scripting can do. Batch scripts parameters are tweaked versions of command prompt codes, so you are only limited to what your command prompt can do. For those unfamiliar with the program, command prompt is capable of quite a lotEssential Windows CMD Commands You Should KnowEssential Windows CMD Commands You Should KnowThe bleak interface of the command prompt is your gateway to advanced Windows tools. We show you essential CMD commands that will let you access them.Read More.
Step 2: Learn the Basics of Batch Scripting
Batch files use the same language as the command prompt. All you're doing is telling the command prompt what you want to input through a file, rather than typing it out in the command prompt. This saves you time and effort. It also allows you to put in some logic (like simple loops, conditional statements, etc. that procedural programming is capable of conceptually).
@echo: This parameter will allow you to view your working script in the command prompt. This parameter is useful for viewing your working code. If any issues arise from the batch file, you will be able to view the issues associated with your script using the echo function. Adding a following off to this parameter will allow you to quickly close your script after it has finished.
title: Providing much of the same function as a tag in HTML, this will provide a title for your batch script in your Command Prompt window.</p><p><strong>cls:</strong> Clears your command prompt, best used when extraneous code can make what you're accessing had to find.</p><p><strong>rem:</strong> Shorthand for <strong>remark </strong>provides the same functionality as <strong><!–</strong> tag in HTML. Rem statements are not entered into your code. Instead, they are used to explain and give information regarding the code.</p><p><strong>%%a:</strong> Each file in the folder.</p><p><strong>('.'):</strong> The root folder. When using the command prompt, one must direct the prompt to a particular directory before changing a files name, deleting a file, and so on. With batch files, you only need to paste your .bat file into the directory of your choosing.</p><p><strong>pause:</strong> Allows a break in the logical chain of your .bat file. This allows for users to read over command lines before proceeding with the code. The phrase 'Press any key to continue…' will denote a pause.</p><p><strong>start '' [website]:</strong> Will head to a website of your choice using your default web browser.</p><p><strong>ipconfig:</strong> This is a classic command prompt parameter that releases information concerning network information. This information includes MAC addresses, IP addresses, and sub-net masks.</p><p><strong>ping:</strong> Pings an IP address, sending data packets through server routes to gauge their location and latency (response time).</p><p>The library for batch variables is huge, to say the least. Luckily there is a Wikibook entry which holds the extensive library of batch script parameters and variables at your disposal.</p><h2>Step 3: Write and Run Your BAT File</h2><p>We'll create two examples of batch scripts which can simplify your daily online and offline activities.</p><h3>News Script</h3><p>Let's create an immediately useful batch script. What if you wanted to open all your favorite news websites the moment you wake up? Since batch scripts use command prompt parameters, we can create a script that opens every news media outlet in a single browser window.</p><p>To re-iterate the batch-making process: first, create an empty text file. <strong>Right-click</strong> an empty space in a folder of your choosing, and select <strong>New</strong>, then <strong>Text Document</strong>. With the text file open, enter the following script. Our example will provide the main American news media outlets available online.</p><p>The above script stacks one<strong> start ''</strong> parameter on top of the other to open multiple tabs. You can replace the links provided with ones of your choosing. After you've entered the script, head to <strong>File</strong>, then <strong>Save As</strong>. In the Save As window, save your file with the <strong>.bat</strong> extension and change the <strong>Save as type</strong> parameter to <strong>All Files (*.*)</strong>.</p><p>Once you'd saved your file, all you need to do is <strong>double-click your BAT file</strong>. Instantly, your web pages will open. If you'd like, you can place this file on your desktop. This will allow you to access all of your favorite websites at once.</p><h3>File Organizer</h3><p>Have you been downloading multiple files a day, only to have hundreds of files clogging up your Download folder? Create a batch file with the following script, which orders your files by file type. Place the .bat file into your disorganized folder, and double-click to run.</p><p>Here is an example of the my desktop before, a loose assortment of image files.</p><p>Here are those same files afterward.</p><p>It's that simple. This batch script will also work with any type of file, whether it's a document, video, or audio file. Even if your PC does not support the file format, the script will create a folder with the appropriate label for you. If you already have a JPG or PNG folder in your directory, the script will simply move your file types to their appropriate location.</p><h2>Automate the Simple Stuff With Batch Scripts</h2><p>This is just a taste of what batch scripts have to offer. If you need something simple done over and over—whether it be ordering files, opening multiple web pages, renaming files en masse, or creating copies of important documents—you can make tedious tasks simple with batch scripts.</p><p>Take things even further by incorporating IF statements into your batch scripts<span><span>5 IF Statements to Use for Smarter Windows Batch Scripts</span><span><span>5 IF Statements to Use for Smarter Windows Batch Scripts</span><span>There are several types of IF statements you can use in a Windows batch file to save time and effort. Check these examples to find out more.</span>Read More</span></span>. And if you're really keen, you may even want to learn PowerShell scripting instead<span><span>5 Reasons You Should Use PowerShell Instead of Batch Scripting</span><span><span>5 Reasons You Should Use PowerShell Instead of Batch Scripting</span><span>PowerShell is what you'd get if you crossed the Command Prompt with Batch Scripting, threw in some extra features, and kicked it all up several notches. Here are several reasons you should try it.</span>Read More</span></span>.</p><p><small>Explore more about: Batch File, Computer Automation, Programming.</small></p><ol><li><div><p>Wish to know more on how to create BATCH file, to let my PC open multiple word files and close files automatically</p></div></li><li><div><p>please please tell me<br />when we finish installation software like IDM,EaseUs etc after installing software then that software website is automatically opened in browser....how can i do this...when i provide software to someone after installation my website is automatically open in browser....please tell me thanks to all</p></div></li><li><div><p>i need to automate the daily email alert for two files size from remote machine (other machine) .</p></div></li><li><div><p>I noticed that after running this script the folder is not refreshed. I added this:</p><p>Send('{F5}')</p><p>to refresh the folder at the end.</p></div></li><li><div><p>i have many .txt file and i want to add few entry and same entry in all .txt file in one shot. please help with codding to create bat file. which should help to pick .txt file from folder and add the define entry in same file and save with same name and same path.<br />please help</p></div></li><li><div><p>i need a batch file for this attrib command so in can apply that attrib command at once for whole drive and its folder & subfolder<br />attrib command to be run ------ attrib -s -h 'here is path for particular folder' i want this atrib run for whole drive and its folder & subfolder .</p><p>pls help me</p></div></li><li><div><p>I automated:</p><p>sfc /scannow</p><p>and</p><p>Dism /Online /Cleanup-Image /RestoreHealth</p><p>Added a pause after the cmds. ?</p><p>I run sfc about once a week.<br />Dism if needed.</p></div></li><li><div><p>Thank you for post</p></div></li><li><div><p>I want commands for writing the logs in the batch file</p></div></li><li><div><p>Thank You so much! I thought bat files were no more : - )))</p></div></li><li><div><p>How to write shell script for export dashboard data to excel automatically in tableau</p></div></li><li><div><p>Hi i am i need to run an exe file twice in a Week automatically by batch file.</p><p>Someone help me to get the commands to create such type of batch File</p></div></li><li><div><p>batch file for running an exe automatically twice in a week</p></div></li><li><div><p>Hi, I'm searching some command to change/save CSV file to/as xlsx.<br />Anybody knows how to do it?</p><p>.csv --> .xlsx</p></div><ul><li><div><p>Of course with batch file... ;)</p></div></li></ul></li><li><div><p>yes I use batch files to program animation, I'm still looking for how to make sound in an animation and how to control the speed</p></div></li><li><div><p>Yes I use batch files to program animation, I'm still looking for how to make sound in a animation and how to control the speed of animation</p></div></li><li><div><p>How to undo the file organizer? :))</p><p>@echo off<br />rem For each file in your folder<br />for %%a in ('.*') do (<br />rem check if the file has an extension and if it is not our script<br />if '%%~xa' NEQ ' if '%%~dpxa' NEQ '%~dpx0' (<br />rem check if extension folder exists, if not it is created<br />if not exist '%%~xa' mkdir '%%~xa'<br />rem Move the file to directory<br />move '%%a' '%%~dpa%%~xa'<br />))</p></div></li><li><div><p>How do I use a batch script to update content of a file? I have an AssemblyInfo.cs file in my project. When deploying my project, I need to update the version content of this file. I need to do this before or after building the application. I understand that I can executing a task during my app build. And in executing this task, I can call a batch script, how can I do this?</p></div></li><li><div><p>what code do I use to make a command (such as /1234) to pop up a text. For Example, when typing '/1234', a text will appear, instead of 'Error'. (Like creating an external command for that batch file)</p></div></li><li><div><p>So is it possible for a custom batch file to have custom commands. For example, typing '/1234' then 'ENTER' will pop up a text. To do this, do I do the same thing in setting up a batch file, but adding '.cmd' instead? How is this possible?</p></div></li><li><div><p>Thank you for the extremely useful information. =) I am a undergraduate and i just needed to refresh my memory on batch files and this was the best place!</p></div></li><li><div><p>Hi,<br />I want to automate my project structure like for every project there is some common structure as per our industry standards that we follow. So if I type 'javaMS create hello-world' , it should create the project structure with all required files and folders with project name and common framework code.</p><p>So how can I automate this instead of creating the structure and copying all the common framework code files every time. Is it possible through batch processing?</p></div></li><li><div><p>Hi ,</p><p>Your article is good. I did not understand the code in the 3rd example. Also could you please help me with the code to uninstall all adobe products from control panel.Thank you in advance.</p></div></li><li><div><p>What is the purpose of the double quotes ( ' ) after the Start command in this? The quotes don't seem to be needed.<br />@echo off<br />start ' http://www.cnn.com<br />start ' http://www.abc.com<br />start ' http://www.msnbc.com<br />start ' http://www.bbc.com<br />start ' http://www.huffingtonpost.com<br />start ' http://www.aljazeera.com<br />start ' https://news.google.com/</p></div></li><li><div><p>$PAM ABOVE</p></div></li><li><div><p>never written a batch file before . something new that I've Learned on my 73rd Birthday youre never too old to learn :)</p></div></li><li><div><p>Thanks a lot .I had a unreasonable fear of bat files.Your write up cleared it</p></div></li><li><div><p>can i make a .bat file so its like i am pressing a button on the keyboard but I am not the file does it for me like a auto clicker but instead a auto button clicker?</p></div></li><li><div><p>Thank you very much for such a valuable article. </p></div></li><li><div><p>Really enjoyed reading and actually running my first BAT file. Thanks a lot mate. Cant thank you enough. </p></div></li><li><div><p>Its very simple and clear...thanks..</p></div></li><li><div><p>my command opens and closes instanly </p></div><ul><li><div><p>add pause command at end of the file</p></div></li></ul></li><li><div><p>Pretty cool stuff! thanks a lot! am excited to learn the bat file creation!!</p></div></li><li><div><p>Nice ... thanks </p></div></li><li><div><p>Oh</p></div></li><li><div><p>NOOOOOOOOO</p></div></li><li><div><p>I'm gonna save this website thanks!</p></div></li><li><div><p>Thanks...</p></div></li><li><div><p>thanks for some quick tips. love #makeuseof</p></div></li><li><div><p>i want to copy 1 file from network pc to my pc. what will be command?. please help...</p></div><ul><li><div><p>I think your too retarded for that</p></div><ul><li><div><p>*you're</p></div></li></ul></li></ul></li><li><div><p>I used it to start an administrator command prompt without having to right click or create a shortcut and modify the properties.</p><p>powershell.exe -Command 'Start-Process cmd -Verb RunAs'<br />exit</p></div></li><li><div><p>Thank you paul it was really help full for me as a biginner</p></div></li><li><div><p>Thanks for sharing this information! It was just what I needed.</p></div></li><li><div><p>I have no idea of programming. I am trying to compress all the files in the folder automatically for the pervious month. How can we do thjis?</p></div></li><li><div><p>in case i want to copy all the contents in c:allfile and D:allfiles to external disk how should the command appear </p><p>xcopy c:users%username% E:user data /o /x /e /h /k<br />xcopy d: e:user datad /o /x /e /h /k </p><p>PAUSE?</p></div></li><li><div><p>Hi</p><p>I need to run commands in karaf shell once it is started by batch file. how to invoke karaf cmd instead of windows cmd</p><p>Thanks.</p></div></li><li><div><p>I created a simple batch file for starting one of our common .jar file installers however after the installation is complete the only thing showing in the folder where the log file is located is an empty log file.</p><p>Ex: start java.exe -DFORCE_OVERRIDE_PRE_REQ=true -jar %~dp0install_||||_x.x.x.x.x.jar 1>%~dp0install_||||_x.x.x.x.x.log 2>&1</p><p>How do I write this so that the log file actually records the install process from start to finish?</p><p>Keep in mind I have been at writing batch files for all of about 1 week.</p></div><ul><li><div><p>Hi Dominic,</p><p>Did you get the script for capturing the log file. Appreciate if you could share.</p></div><ul><li><div><p>Hello Varun,</p><p>The fix for my issue is to simply run the batch file from the folder where the .jar file is located. I was running the batch from outside the folder which caused the issue.</p><p>Dom</p></div></li></ul></li></ul></li><li><div><p>guys anyone help me out to copy the files from the desktop in the back end with the bat file please help me out</p></div><ul><li><div><p>source_file copy destination_location</p></div></li></ul></li><li><div><p>Hello every one.</p><p>is it possible when i type a website, bat file will automatically execute?</p></div></li><li><div><p>I need to create a batch file to allow a colleague to load multiple jpegs to a site. The jpegs are on my local drive and my colleague is a 3rd party vendor. </p><p>My questions are:<br />1. do i need to load these jpeg files onto a shared server<br />2. I was told to use the 'Xref' command... can someone walk me through this or is there a better command/solution?</p><p>Thanks!</p></div></li><li><div><p>I have two monitors set up, one for gaming and a larger TV for watching movies. Often times I only want to use one, so I made a few .bat files and set them up as 'Launch Program' hotkeys on my Razer keyboard. Basically hitting M1 shuts off the secondary monitor, and M2 turns on the second display.</p><p>Main.bat<br />%windir%System32DisplaySwitch.exe /external</p><p>Extend.bat<br />%windir%System32DisplaySwitch.exe /extend</p><p>By default, the secondary display becomes primary, most likely because of the Display settings in Windows, it seems to remember which one is supposed to be primary.</p></div></li><li><div><p>ECHO OFF<br />::<br />ECHO<br />::<br />REG add 'HKCUControl PanelDesktop' /v ForegroundLockTimeout /t REG_DWORD /d 0 /f<br />REG add 'HKCUControl PanelDesktop' /v MenuShowDelay /t REG_SZ /d 100 /f<br />REG add 'HKLMSYSTEMCurrentControlSetControl' /v WaitToKillServiceTimeout /t REG_SZ /d 5000 /f<br />::<br />cd <br />md startupfolderbackup<br />cd windows<br />cd 'start menu'<br />cd programs<br />cd startup<br />dir /w<br />::<br />ipconfig /flushdns<br />::<br />PAUSE<br />::<br />sfc /scannow</p></div></li><li><div><p>I am also created a batch file successfully But it asking administrator mode.what i do now?</p></div><ul><li><div><p>here my batch file...</p><p>@echo off<br />netsh wlan start hostednetwork<br />pause</p></div><ul><li><div><p>@echo off<br />netsh wlan set hostednetwork mode=allow ssid=stephen key=password<br />netsh wlan start hostednetwork</p><p>and save it as a wifi.bat file</p><p>and now write click on file and click on Run as Administrator</p><p>now go to ur wifi and shared ur wifi</p></div></li></ul></li></ul></li><li><div><p>I created a batch file to backup my Assassin's Creed savegame files. The other night I accidentally started a new game after having previously finished the first big mission and I wanted to gouge my own eyes out. Because I don't have that game on any cloud service there's no automagic backups of my savegame so I realized it would have been great if I had backed up the save so I wrote a quick BAT for my desktop so that when I finish playing, I just double-click the file and the save is backed up -- no more starting from the beginning again!</p><p>I was trying to figure out why it wasn't working, because the last time I wrote a batch file was back during the days of Windows 95, and I thought I'd do some research when I came across this post. It helped to reload my hacker memory with just the description of a few commands, and then I realized that the reason why the code wasn't working was that I had to use quotes around my file paths.</p></div></li><li><div><p>How do I do this?</p><p>Create a Batch file for Backups<br />Create a simple batch file using the x copy command<br />Copy the files and sub directories (non-empty) from C:Data to G:backup</p><p>i. For the G: drive we are pretending that it would be an external drive that we have connected – we don't need a G: to be present – but use G:backup as your destination for the batch file command</p><p>Save the batch file as the following: C:BatchWeekly_Backup.bat</p></div></li><li><div><p>Great Job !!</p></div></li><li><div><p>Really nice guide!</p></div></li><li><div><p>Wow! This is really wonderful, I have tried the sample code and its working.<br />Thanks for giving me a good start to creating scripts using command prompt<br />Big up to you.</p></div></li><li><div><p>Hi There,</p><p>I to get one suggestion, weekly I am taking DB dump for 15 schema. So I want to automate this process.<br />For that I created a batch file and it compiles successfully, only need to change date weekly basis.</p><p>Can you please suggest me how to change date automatically in BATCH file and how to put that BATCH file in Windows path, so it takes dump automatically as weekly basis??</p><p>My system: Winsdows 7: 64 bit</p><p>Thanks!</p></div></li><li><div><p>I tried the test code but I didn't get the PING info. I copied & pasted the code :(</p></div><ul><li><div><p>Peter press enter or pause( any key)it will continue and you will get the ping info</p></div></li></ul></li><li><div><p>i tried your sample code, I need your suggestion for this.</p><p>I have 200 folders in D:dst the names of these 200 folders would be like (X123, Y123, Z123 ....) now i need to copy some of these folders say (X123 and Z123) to a destionation C:New Folder.</p><p>in my case i need to copy the whole folder rather than a file.</p><p>Please suggest how i can achieve this.</p><p>Thanks | Ravindra.R</p></div><ul><li><div><p>Take sometime...</p><p>or</p></div></li></ul></li><li><div><p>Hi,</p></div></li><li><div><p>Thanks, you saved me a lot of time</p></div></li><li><div><p>Kelly,</p><p>If you are attempting this at your work, its very possible that your company has 'deny ICMP messages' implemented on their network devices (router/switch). This is a security blanket for IT professionals to prevent DoS attacks. If you are at home and this is happening, it may be possible that your ISP is preventing the use of ICMP messages? It's hard to tell without really knowing how your computer and network are setup.</p></div></li><li><div><p>Thank you very much !!! :)</p></div></li><li><div><p>very nice</p></div></li><li><div><p>I found this very useful, thank you</p></div></li><li><div><p>How can I get this to work for the following command?<br />for /r %i in (*.dll) do regsvr32 /s '%i'<br />Please help</p></div></li><li><div><p>Hello!<br />I copied and pasted the entire example and.... its running successfully!! (Many thanks!!)<br />But I kept getting Request timed out at ping http://www.google.com portion!<br />Im am currently connected to the internet and i can do a google search!!</p><p>I tried changing it to PING makeuseof.com but it also shows request timed out!</p><p>Any ideas?</p></div></li><li><div><p>Well, congrats and thanks. It's always the most basic information that are the most difficult to get and you've done it perfectly. </p></div></li><li><div><p>I really liked the post.</p><p>After reading the post I would like to implement it in my work to make it easier and less time consuming. Can we update a column in the Database for the bulk of data at once?</p><p>If yes, can you please provide the sample code for it. I would be very thankful for the same.</p><p>Thanks in Advance. Kaushal</p></div></li><li><div><p>Can anyone help me to create one batch file for connecting VPN automatically. Because we keep selenium test execution in the night. But due to some technical issues the vpn is getting disconnect automatically.</p><p>For our automation testing we have to connect Junos VPN , login with credentials. and it should click on connect. Then my selenium automation script should continue our test execution,</p><p>So I am looking for a script for batch file or java file which should run in selenium web driver.</p><p>Please feel free to share your ideas to me at mallumulage@gmail.com</p></div></li><li><div><p>Hi Nathan,</p><p>When I gave input as 1 and enter, it is returning error like this.</p><p>'ô1ö is not valid please try again' for all the value it is displaying this error. please advice.</p><p>Regards,<br />Khaleel</p></div><ul><li><div><p>It's because (double and single) quotation marks you've copied from the text are not accepted in windows command prompt. Copy all script to text file and replace these characters:<br />' with '<br />' with '<br />' with '<br />? with '</p></div></li></ul></li><li><div><p>Here is a bat file ive been coding in my free time....</p><p>title PC TOOLS (C) Marcus Meyer designed by NATHAN VAN NIEKERK Version 2.0<br />@echo off</p><p>color 0c<br />cls<br />echo (C) Marcus Meyer designed by NATHAN VAN NIEKERK<br />echo.<br />cls<br />goto start</p><p>rem ####################### START ######################<br />:start<br />echo (C) Marcus Meyer designed by NATHAN VAN NIEKERK<br />echo.<br />color 0a<br />echo %name% WELCOME TO PC TOOLS!!<br />echo What option would you like to execute?<br />echo.<br />echo NETWORKING:<br />echo _____________<br />echo 1) Ipconfig<br />echo 2) Ping an ip address<br />echo 3) Trace Root<br />echo 4) NetStat<br />echo 5) Get Mac address<br />echo.<br />echo SYSTEM INFO:<br />echo ______________<br />echo 6) Who am I<br />echo 7) PC INFO<br />echo 8) Performance Check<br />echo 9) Disk Check<br />echo 10) Driver Check<br />echo 11) Mirror Drive<br />echo 12) Recover Drive<br />echo.<br />echo WINDOWS TOOLS:<br />echo __________________<br />echo 13) Clear recycle bin and Temporary files<br />echo 14) Hard drive Defrag<br />echo 15) Start or End a Task<br />echo.</p><p>echo 16) Exit</p><p>echo.<br />set option=<br />echo.<br />set /p option=Select One:<br />echo.<br />if '%option%'1' goto ipconfig<br />if '%option%'2' goto ping<br />if '%option%'3' goto tracert<br />if '%option%'4' goto netstat<br />if '%option%'5' goto getmac<br />if '%option%'6' goto whoami<br />if '%option%'7' goto pcinfo<br />if '%option%'8' goto perfmon<br />if '%option%'9' goto CHKDSK<br />if '%option%'10' goto DRIVER<br />if '%option%'11' goto MIR<br />if '%option%'12' goto recover<br />if '%option%'13' goto clearmgr<br />if '%option%'14' goto defrag<br />if '%option%'15' goto task<br />if '%option%'16' goto exit<br />echo.<br />ECHO '%option%' is not valid please try again<br />goto start<br />ECHO.</p><p>rem ###################### Options #####################</p><p>rem ###################### ipconfig #######################<br />:ipconfig</p><p>color 0c<br />echo.<br />ipconfig<br />pause<br />cls<br /> goto start</p><p>rem ###################### ping #######################<br />:ping<br />color 0b<br />echo If you dont know the ip adress of the target pc, you can find the other target IP Address, by using our program and option 1<br />pause<br />echo Please enter the IP adress you would like to ping?<br />echo.<br />Set /p ip=<br />ping %ip%<br />pause<br />cls<br />goto start</p><p>rem ###################### tracert #######################<br />:tracert<br />color 0b<br />echo Please enter web page you would like to trace?<br />echo.<br />Set /p trace=<br /> echo.<br />echo Trace Root initiate<br />tracert %trace%<br />pause<br />cls<br /> goto start</p><p>rem ###################### netstat #######################<br />:netstat<br />color 0f<br />echo.<br />netstat<br />pause<br />cls<br />goto start</p><p>rem ###################### getmac #######################<br />:getmac<br />@echo off<br />color 0e<br />echo.<br />getmac<br />echo.<br />echo Have you got all the info needed?<br />pause<br />cls<br />goto start</p><p>rem ###################### whoami #######################<br />:whoami<br />color 0d<br />whoami<br />pause<br />cls<br />goto start</p><p>rem ###################### pcinfo #######################<br />:pcinfo<br />color 0e<br />systeminfo<br />pause<br />cls<br />goto start</p><p>rem ###################### clearmgr#######################<br />:clearmgr<br />echo Just follow the On Screen instructions and Press OK, Press Delete and OK.<br />CleanMgr<br />echo DONE!!<br />pause<br />cls<br />goto start</p><p>rem ###################### defrag #######################<br />:defrag<br />echo You will need to run this program as Administrator<br />echo This will Defrag all volumes:<br />pause<br />defrag /C /H /V<br />pause<br />cls<br />goto start</p><p>rem ###################### perfmon #######################<br />:perfmon<br />color 0b<br />echo.<br />echo Please wait program starting...<br />PERFMON<br />pause<br />cls<br />goto start</p><p>rem ###################### CHKDSK#######################<br />:CHKDSK<br />echo Please enter the drive you would like to check?<br />echo.<br />Set /p DSK=<br />echo.<br />cls<br />echo Check disk initiate<br />CHKDSK %DSK%:<br />pause<br />cls<br />goto start<br />rem ###################### DRIVER#######################<br />:DRIVER<br />DRIVERQUERY<br />pause<br />cls<br />goto start </p><p>rem ###################### MIR #######################<br />:MIR</p><p>color 0c<br />echo Please Enter the Source DRIVE<br />echo.<br />set /p SOURCE=<br />echo Please Enter the Destination DRIVE<br />echo.<br />set /p DEST=<br />ROBOCOPY %SOURCE%: %DEST%: /MIR<br />pause<br />cls<br />goto start</p><p>rem ###################### recover #######################<br />:recover<br />echo Please Enter the Source file path<br />echo.<br />set /p SOURCE=<br />TYPE SOURCE<br />pause<br />cls<br />goto start</p><p>rem ###################### task #######################<br />:task<br />cls<br />echo TASK KILL OR START TASK MENU<br />echo.<br />echo What option would you like to execute?<br />echo.<br />echo 1) Task Kill<br />echo 2) start task<br />echo 3) back</p><p>echo.<br />set option=<br />echo.<br />set /p option=Select One:<br />echo.</p><p>if '%option%'1' goto taskkill<br />if '%option%'2' goto starttask<br />if '%option%'3' goto back</p><p>################# taskkill ###################<br />:taskkill<br />echo What process would you like to end?<br />echo.<br />set /p task_name= task name without .exe<br />taskkill /f /im %task_name%.exe<br />pause<br />cls<br />goto task</p><p>################# starttask ###################<br />:starttask<br />echo What process would you like to start?<br />echo.<br />set /p task_name=<br />start %task_name%</p><p>cls<br />pause<br />goto task..</p><p>################# back ###################<br />:back<br />cls<br />goto start</p><p>rem ###################### exit #######################<br />:exit<br />echo Are you sure you want to EXIT?<br />pause<br />exit</p></div><ul><li><div><p>I take de liberty to change a litle your batch file.<br />i wope you don't mind .<br />you can add those if you want:<br />displaydns<br />flush dns<br />ipconfig/realese<br />ipconfig/renew<br />routeprint<br />and remote assistant as well<br />title PC TOOLS (C) Marcus Meyer designed by NATHAN VAN NIEKERK Version 2.0<br />mode 48,40<br />@echo off<br />color 0c<br />cls<br />echo (C) Marcus Meyer designed by NATHAN VAN NIEKERK<br />echo.<br />cls<br />goto start<br />rem ####################### START ######################<br />:start<br />echo (C) Marcus Meyer designed by NATHAN VAN NIEKERK<br />echo.<br />mode 48,40<br />color 0a<br />echo %username% WELCOME TO PC TOOLS!!<br />echo What option would you like to execute?<br />echo.<br />echo NETWORKING:<br />echo _____________<br />echo 1) Ipconfig<br />echo 2) Ping an ip address<br />echo 3) Trace Root<br />echo 4) NetStat<br />echo 5) Get Mac address<br />echo.<br />echo SYSTEM INFO:<br />echo ______________<br />echo 6) Who am I<br />echo 7) PC INFO<br />echo 8) Performance Check<br />echo 9) Disk Check<br />echo 10) Driver Check<br />echo 11) Mirror Drive<br />echo 12) Recover Drive<br />echo.<br />echo WINDOWS TOOLS:<br />echo __________________<br />echo 13) Clear recycle bin and Temporary files<br />echo 14) Hard drive Defrag<br />echo 15) Start or End a Task<br />echo.<br />echo 16) Exit<br />echo.<br />set option=<br />echo.<br />set /p option=Select One:<br />echo.<br />if '%option%'1' goto ipconfig<br />if '%option%'2' goto ping<br />if '%option%'3' goto tracert<br />if '%option%'4' goto netstat<br />if '%option%'5' goto getmac<br />if '%option%'6' goto whoami<br />if '%option%'7' goto pcinfo<br />if '%option%'8' goto perfmon<br />if '%option%'9' goto CHKDSK<br />if '%option%'10' goto DRIVER<br />if '%option%'11' goto MIR<br />if '%option%'12' goto recover<br />if '%option%'13' goto clearmgr<br />if '%option%'14' goto defrag<br />if '%option%'15' goto task<br />if '%option%'16' goto exit<br />echo.<br />ECHO '%option%' is not valid please try again<br />goto start<br />ECHO.<br />rem ###################### Options #####################<br />rem ###################### ipconfig #######################<br />:ipconfig<br />mode 70,40<br />cls<br />color 0c<br />echo.<br />ipconfig<br />pause<br />cls<br />goto start<br />rem ###################### ping #######################<br />:ping<br />cls<br />color 0b<br />@echo off<br />mode 45,2<br />color 0F<br />set /p a='Enter IP ADDRESS: '<br />MODE 60,15<br />ping %a%<br />echo [----------------------------------------------------------]<br />pause<br />cls<br />goto start<br />rem ###################### tracert #######################<br />:tracert<br />mode 60,5<br />cls<br />color 0b<br />echo Please enter web page you would like to trace?<br />echo [EXAMPLE] http://www.google.com<br />echo.<br />Set /p trace=<br />mode 75,50<br />echo.<br />echo Trace Root initiate<br />tracert %trace%<br />pause<br />cls<br />goto start<br />rem ###################### netstat #######################<br />:netstat<br />@echo off<br />color 0F<br />:options<br />mode 45,10<br />cls<br />echo MENU OPTIONS:<br />echo <br />echo a All links<br />echo e Ethernet Statistics<br />echo f Displays FDQN<br />echo n Addresses and ports<br />echo <br />echo q to quit<br />echo <br />set /p input='Enter Options Here: '</p><p>if '%input%'a' goto:a<br />if '%input%'e' goto:e<br />if '%input%'f' goto:f<br />if '%input%'n' goto:n<br />if '%input%'q' goto:start</p><p>echo Please choose from the Options listed above!<br />pause<br />goto:options</p><p>:a<br />mode 80,60<br />netstat.exe -a<br />pause<br />goto:options</p><p>:e<br />mode 80,15<br />netstat.exe -e<br />pause<br />goto:options</p><p>:f<br />mode 80,25<br />netstat.exe -f<br />pause<br />goto:options</p><p>:n<br />mode 80,20<br />netstat.exe -n<br />pause<br />goto:options<br />rem ###################### getmac #######################<br />:getmac<br />mode 60,25<br />@echo off<br />cls<br />color 0e<br />echo.<br />arp -a<br />echo.<br />echo Have you got all the info needed?<br />pause<br />cls<br />goto start<br />rem ###################### whoami #######################<br />:whoami<br />mode 45,5<br />color 0d<br />whoami<br />pause<br />cls<br />goto start<br />rem ###################### pcinfo #######################<br />:pcinfo<br />mode 80,60<br />cls<br />color 0e<br />systeminfo<br />pause<br />cls<br />goto start<br />rem ###################### perfmon #######################<br />:perfmon<br />mode 45,5<br />cls<br />color 0b<br />echo.<br />echo Please wait program starting!<br />PERFMON<br />pause<br />cls<br />goto start<br />rem ###################### CHKDSK#######################<br />:CHKDSK<br />mode 48,5<br />cls<br />echo Please enter the drive you would like to check?<br />echo.<br />Set /p DSK=<br />echo.<br />cls<br />echo Check disk initiate<br />CHKDSK %DSK%:<br />pause<br />cls<br />goto start<br />rem ###################### clearmgr#######################<br />:clearmgr<br />echo Just follow the On Screen instructions and Press OK, Press Delete and OK.<br />CleanMgr<br />echo DONE!!<br />pause<br />cls<br />goto start<br />rem ###################### defrag #######################<br />:defrag<br />echo You will need to run this program as Administrator<br />echo This will Defrag all volumes:<br />pause<br />defrag /C /H /V<br />pause<br />cls<br />goto start</p><p>rem ###################### DRIVER#######################<br />:DRIVER<br />mode 48,50<br />cls<br />DRIVERQUERY<br />pause<br />cls<br />goto start<br />rem ###################### MIR #######################<br />:MIR<br />color 0c<br />echo Please Enter the Source DRIVE<br />echo.<br />set /p SOURCE=<br />echo Please Enter the Destination DRIVE<br />echo.<br />set /p DEST=<br />ROBOCOPY %SOURCE%: %DEST%: /MIR<br />pause<br />cls<br />goto start<br />rem ###################### recover #######################<br />:recover<br />echo Please Enter the Source file path<br />echo.<br />set /p SOURCE=<br />TYPE SOURCE<br />pause<br />cls<br />goto start<br />rem ###################### task #######################<br />:task<br />mode 40,10<br />cls<br />echo TASK KILL OR START TASK MENU<br />echo.<br />echo What option would you like to execute?<br />echo.<br />echo T) Tasklist<br />echo 1) Task Kill<br />echo 2) start task<br />echo 3) back<br />echo.<br />set option=<br />echo.<br />set /p option=Select One:<br />echo.<br />if '%option%'T' goto tasklist<br />if '%option%'1' goto taskkill<br />if '%option%'2' goto starttask<br />if '%option%'3' goto back<br />################# tasklist ###################<br />:tasklist<br />mode 48,50<br />cls<br />echo The fowlling process are actives!<br />tasklist<br />pause<br />cls<br />goto task<br />################# taskkill ###################<br />:taskkill<br />echo What process would you like to end?<br />echo.<br />set /p task_name= task name without .exe<br />taskkill /f /im %task_name%.exe<br />pause<br />cls<br />goto task<br />################# starttask ###################<br />:starttask<br />echo What process would you like to start?<br />echo.<br />set /p task_name=<br />start %task_name%<br />cls<br />pause<br />goto task..<br />################# back ###################<br />:back<br />cls<br />goto start<br />###################### exit #######################<br />:exit<br />mode 45,5<br />cls<br />echo Are you sure you want to EXIT?<br />echo Select c to cancel or press ok to exit<br />set /p input='Enter Options Here: '<br />if '%input%'ok' goto:ok<br />if '%input%'c' goto:start</p></div><ul><li><div><p>i would like to ask about the script that you have edited, is there anything that should be removed so the script runs without interruption, i mean the coments that you did during the script.<br />i am a beginner into scripting but i love it.<br />thanks a lot it is really very nice to see this kind of scripts<br />if you dont mind please send it to my e-mail</p></div><ul><li><div><p>title PC TOOLS (C) Marcus Meyer designed by NATHAN VAN NIEKERK Version 2.0<br />mode 48,40<br />@echo off<br />color 0c<br />cls<br />echo (C) Marcus Meyer designed by NATHAN VAN NIEKERK<br />echo.<br />cls<br />goto start<br />rem ####################### START ######################<br />:start<br />echo (C) Marcus Meyer designed by NATHAN VAN NIEKERK<br />echo.<br />mode 48,40<br />color 0a<br />echo %username% WELCOME TO PC TOOLS!!<br />echo What option would you like to execute?<br />echo.<br />echo NETWORKING:<br />echo _____________<br />echo 1) Ipconfig<br />echo 2) Ping an ip address<br />echo 3) Trace Root<br />echo 4) NetStat<br />echo 5) Get Mac address<br />echo.<br />echo SYSTEM INFO:<br />echo ______________<br />echo 6) Who am I<br />echo 7) PC INFO<br />echo 8) Performance Check<br />echo 9) Disk Check<br />echo 10) Driver Check<br />echo 11) Mirror Drive<br />echo 12) Recover Drive<br />echo.<br />echo WINDOWS TOOLS:<br />echo __________________<br />echo 13) Clear recycle bin and Temporary files<br />echo 14) Hard drive Defrag<br />echo 15) Start or End a Task<br />echo.<br />echo 16) Exit<br />echo.<br />set option=<br />echo.<br />set /p option=Select One:<br />echo.<br />if '%option%'1' goto ipconfig<br />if '%option%'2' goto ping<br />if '%option%'3' goto tracert<br />if '%option%'4' goto netstat<br />if '%option%'5' goto getmac<br />if '%option%'6' goto whoami<br />if '%option%'7' goto pcinfo<br />if '%option%'8' goto perfmon<br />if '%option%'9' goto CHKDSK<br />if '%option%'10' goto DRIVER<br />if '%option%'11' goto MIR<br />if '%option%'12' goto recover<br />if '%option%'13' goto clearmgr<br />if '%option%'14' goto defrag<br />if '%option%'15' goto task<br />if '%option%'16' goto exit<br />echo.<br />ECHO '%option%' is not valid please try again<br />goto start<br />ECHO.<br />rem ###################### Options #####################<br />rem ###################### ipconfig #######################<br />:ipconfig<br />mode 70,40<br />cls<br />color 0c<br />echo.<br />ipconfig<br />pause<br />cls<br />goto start<br />rem ###################### ping #######################<br />:ping<br />cls<br />color 0b<br />@echo off<br />mode 45,2<br />color 0F<br />set /p a='Enter IP ADDRESS: '<br />MODE 60,15<br />ping %a%<br />echo [----------------------------------------------------------]<br />pause<br />cls<br />goto start<br />rem ###################### tracert #######################<br />:tracert<br />mode 60,5<br />cls<br />color 0b<br />echo Please enter web page you would like to trace?<br />echo [EXAMPLE] http://www.google.com<br />echo.<br />Set /p trace=<br />mode 75,50<br />echo.<br />echo Trace Root initiate<br />tracert %trace%<br />pause<br />cls<br />goto start<br />rem ###################### netstat #######################<br />:netstat<br />@echo off<br />color 0F<br />:options<br />mode 45,10<br />cls<br />echo MENU OPTIONS:<br />echo <br />echo a All links<br />echo e Ethernet Statistics<br />echo f Displays FDQN<br />echo n Addresses and ports<br />echo <br />echo q to quit<br />echo <br />set /p input='Enter Options Here: '</p><p>if '%input%'a' goto:a<br />if '%input%'e' goto:e<br />if '%input%'f' goto:f<br />if '%input%'n' goto:n<br />if '%input%'q' goto:start</p><p>echo Please choose from the Options listed above!<br />pause<br />goto:options</p><p>:a<br />mode 80,60<br />netstat.exe -a<br />pause<br />goto:options</p><p>:e<br />mode 80,15<br />netstat.exe -e<br />pause<br />goto:options</p><p>:f<br />mode 80,25<br />netstat.exe -f<br />pause<br />goto:options</p><p>:n<br />mode 80,20<br />netstat.exe -n<br />pause<br />goto:options<br />rem ###################### getmac #######################<br />:getmac<br />mode 60,25<br />@echo off<br />cls<br />color 0e<br />echo.<br />arp -a<br />echo.<br />echo Have you got all the info needed?<br />pause<br />cls<br />goto start<br />rem ###################### whoami #######################<br />:whoami<br />mode 45,5<br />color 0d<br />whoami<br />pause<br />cls<br />goto start<br />rem ###################### pcinfo #######################<br />:pcinfo<br />mode 80,60<br />cls<br />color 0e<br />systeminfo<br />pause<br />cls<br />goto start<br />rem ###################### perfmon #######################<br />:perfmon<br />mode 45,5<br />cls<br />color 0b<br />echo.<br />echo Please wait program starting!<br />PERFMON<br />pause<br />cls<br />goto start<br />rem ###################### CHKDSK#######################<br />:CHKDSK<br />mode 48,5<br />cls<br />echo Please enter the drive you would like to check?<br />echo.<br />Set /p DSK=<br />echo.<br />cls<br />echo Check disk initiate<br />CHKDSK %DSK%:<br />pause<br />cls<br />goto start<br />rem ###################### clearmgr#######################<br />:clearmgr<br />echo Just follow the On Screen instructions and Press OK, Press Delete and OK.<br />CleanMgr<br />echo DONE!!<br />pause<br />cls<br />goto start<br />rem ###################### defrag #######################<br />:defrag<br />echo You will need to run this program as Administrator<br />echo This will Defrag all volumes:<br />pause<br />defrag /C /H /V<br />pause<br />cls<br />goto start</p><p>rem ###################### DRIVER#######################<br />:DRIVER<br />mode 48,50<br />cls<br />DRIVERQUERY<br />pause<br />cls<br />goto start<br />rem ###################### MIR #######################<br />:MIR<br />color 0c<br />echo Please Enter the Source DRIVE<br />echo.<br />set /p SOURCE=<br />echo Please Enter the Destination DRIVE<br />echo.<br />set /p DEST=<br />ROBOCOPY %SOURCE%: %DEST%: /MIR<br />pause<br />cls<br />goto start<br />rem ###################### recover #######################<br />:recover<br />echo Please Enter the Source file path<br />echo.<br />set /p SOURCE=<br />TYPE SOURCE<br />pause<br />cls<br />goto start<br />rem ###################### task #######################<br />:task<br />mode 40,10<br />cls<br />echo TASK KILL OR START TASK MENU<br />echo.<br />echo What option would you like to execute?<br />echo.<br />echo T) Tasklist<br />echo 1) Task Kill<br />echo 2) start task<br />echo 3) back<br />echo.<br />set option=<br />echo.<br />set /p option=Select One:<br />echo.<br />if '%option%'T' goto tasklist<br />if '%option%'1' goto taskkill<br />if '%option%'2' goto starttask<br />if '%option%'3' goto back<br />################# tasklist ###################<br />:tasklist<br />mode 48,50<br />cls<br />echo The fowlling process are actives!<br />tasklist<br />pause<br />cls<br />goto task<br />################# taskkill ###################<br />:taskkill<br />echo What process would you like to end?<br />echo.<br />set /p task_name= task name without .exe<br />taskkill /f /im %task_name%.exe<br />pause<br />cls<br />goto task<br />################# starttask ###################<br />:starttask<br />echo What process would you like to start?<br />echo.<br />set /p task_name=<br />start %task_name%<br />cls<br />pause<br />goto task..<br />################# back ###################<br />:back<br />cls<br />goto start<br />###################### exit #######################<br />:exit<br />mode 45,5<br />cls<br />echo Are you sure you want to EXIT?<br />echo Select c to cancel or press ok to exit<br />set /p input='Enter Options Here: '<br />if '%input%'ok' goto:ok<br />if '%input%'c' goto:start</p></div></li><li><div><p>hello and happy new year<br />i saw the batch file and i tested it.<br />option no: 7 seems to be nos so clear, i mean there is nothing about pc info<br />:)</p><p>regards and thanks in advance</p></div></li></ul></li></ul></li></ul></li><li><div><p>Hey! can eny1 help me out to create a .bat file, which if i will put it in a folder with lots of data & open it it repeats the same folder where the bat file is, because my friend once did it with me during my school days but i forgot to ask him so eny1 plz hlp<br />& also if there is eny program that if i click the bat file the computer will go to sleep automatically, if some program like that is there plz inform me.</p></div></li><li><div><p>Here is a fun batch file. Type:<br />Title VIRUS<br />Color 02<br />echo off<br />cls</p><p>echo VIRUS DETECTED<br />pause<br />cls<br />echo DO YOU WISH TO DELETE VIRUS? (Y/N)<br />pause<br />cls<br />echo DELETING ALL FILES<br />pause<br />cls<br />echo MICROSOFT PROGRAM DELETED<br />Pause<br />echo GOODBYE<br />pause<br />cls</p></div><ul><li><div><p>Why even use a cls at the end? The user probably wouldn't even notice it. Funny idea though.</p></div></li><li><div><p>Well another thing you could do is disguise it as their main internet icon so that whenever they click on it this will always pop up. I did that to a friend they couldn't figure it out.</p></div></li><li><div><p>lol, I'll have to try that sometime. Might want to go with a bright red instead of green, color b or color c I believe. </p></div></li><li><div><p>The reason I picked 02 was for a black background with a red font. It appears better than some other combinations that I have seen.</p></div></li><li><div><p>Here is a tweek to your prank.....<br />Title VIRUS<br />Color 02<br />echo off<br />cls<br />echo VIRUS DETECTED<br />pause<br />cls<br />echo DO YOU WISH TO DELETE VIRUS? (Y/N)<br />pause<br />cls<br />echo DELETING ALL FILES<br />pause<br />cls<br />echo MICROSOFT PROGRAM DELETED<br />Pause<br />echo GOODBYE<br />shutdown -s -f -t 5 -c 'GoodBye'</p></div></li><li><div><p>Type color/? into cmd.exe to get the full combination of colors availible</p></div></li></ul></li><li><div><p>i have a problem, when i right click on my bat file and then click on edit, it opens like a txt file, not a black command file</p></div><ul><li><div><p>It is supposed to</p></div></li><li><div><p>Because you create them with a text editor... That's how they're supposed to work.</p></div></li></ul></li><li><div><p>I do so much stuff with batch files. I created a batch file where I can type in a specific number, and it opens a program corresponding to the number. If I type in a number for a Google product, it opens it, and then opens a vbscript file that types on my username and password automatically. after a while typing in code and fixing bugs on a batch program turned fun. good luck to anyone trying it out :)</p></div></li><li><div><p>Can't read what the description says to do because of all the ads on the right side of the screen site on top of the text, too bad. I'll have to learn somewhere else. </p></div></li><li><div><p>Hi to all you guys who are keen on Batch Files.<br />Can batch files be created to run automatically i.e. triggered by an event? Would a batch file be an appropriate way of deleting an old file when an imaging software starts to create a new file. I have space on a partition to store say 3 files & would like to be able to automatically delete the oldest (by date) file before the next/newest (4th?) file is created.<br />Thanks,<br />Clive</p></div></li><li><div><p>My job involves setting up new computers for workers at a large corporation. The guy in the job before me would network two computers and copy files manually from folder to folder. Could take hours and failed frequently, forcing you to restart because you had no idea where Windows left off. I wrote a batch script that maps a network drive to the old computer and copies everything that a user has created that is not in our standard image of windows. Now I sit back and watch it run.</p></div><ul><li><div><p>Could you give me the script</p></div></li><li><div><p>Hello Josh<br />Can you provide to me that batch file please.<br />duraku.aranit@gmail.com</p></div></li></ul></li><li><div><p>Here is a usefull site for scripting not just Batch Scripting but it does have a very comprehensive section on batch scripting and it is an invaluable resource for those who routinely write scripts.</p></div></li><li><div><p>Here is a usefull site for scripting not just Batch Scripting but it does have a very comprehensive section on batch scripting and it is an invaluable resource for those who routinely write scripts.</p></div></li><li><div><p>Nice beginners guide to batch scripting. VBscript and powershell are great tools and have their place but batch files are indispensable. I work in IT and am often surprised at how few of my colleagues actually utilize batch files for daily tasks. In the 10+ years I've been doing this I've written literally hundreds of batch files with at least 10 that I use daily. The best one I've ever written runs against my print servers and pulls out all the print job information (Username, doc type, doc name, pages printed etc) and puts that into a csv file. Very useful for tracking printer usage.</p></div><ul><li><div><p>Could you send me batch files inregard to network backup were data backup will start when a laptopis connected on the network to a storage unit on a computer</p></div></li></ul></li><li><div><p>Can a batch file open several programs that have to keep running (e.g. I want a batch file that opens Chrome, Itunes, etc. but when I tried it, it stopped after chrome, and only continues when I closed chrome.)<br />Any solutions?</p></div></li><li><div><p>Is there a batch command that would allow snapping a window to the right/left half of the screen in Windows 7?</p><p>I am trying to make a .bat file that opens 2 Windows Explorer windows, each on its half screen.</p></div><ul><li><div><p>Windows 7 has gestures, you can drag windows to ceertain parts of the screen side and it will snap them into position. Google for more information on it.</p></div></li></ul></li><li><div><p>I think that batch files will be around for a while. I use batch files on a daily basis and it is very time efficient method of getting things done with minimal input.<br />Here is my daily batch:<br />ECHO OFF<br />ECHO This is CCleaner silent run with DNS flush. I use this after I log in to my bank and close Firefox.<br />'C:Program FilesCCleanerCCleaner.exe' /AUTO<br />ipconfig /flushdns<br />ECHO Privacy is important !!! All good now.<br />PAUSE<br /></p><p>Hope this helps.<br />Regards,<br />Ivan K.</p></div></li><li><div><p>I Just Loved To Read This Post.<br />Really I Love Such Type Of Programming.<br />I Really Love Programming But Sadly Donno As Now I M Only Of 14 Years And In School.<br />So Don Have Time To Do These.</p></div><ul><li><div><p>I had started to do some batch files at 14. I learned from a friend and it was fun. I just made a few joke batch files and then my friend put a file on my computer that turned my capslock on and off repeatedly. </p></div></li></ul></li><li><div><p>Batch files are still kind of fun really just to get them to do some simple things. These are still handy for starting up some simple tasks with a minimal amount of code necessary to get the tasks done.</p></div></li></ol><div><span>Active</span>1 year, 4 months ago</div><h3 id='sample-program-script'>Sample Program Script</h3><p>I usually perform actions in the 7zip command line program. I was thinking about creating a small script to do everything automatically, but I have never written any Windows shell script before and therefore don't even know where to begin.</p><p>I would like to make an executable script file which, when a user double-clicks on it, will call the 7zip command line and perform some actions.</p><p>First of all, is this possible? And if it is, what is the best way to do this?</p>user1301428<span>user1301428</span><div><span>816</span><span aria-hidden='true'>3</span><span>3 gold badges</span><span aria-hidden='true'>17</span><span>17 silver badges</span><span aria-hidden='true'>45</span><span>45 bronze badges</span></div><h2> 2 Answers </h2><p>You can create a batch script to do this.</p><p>It's basically command line commands that run one after another so you don't have to keep typing them in :)</p><p>Put the commands you would normally use for 7zip in a notepad file and save it with the extension <code>.bat</code>, then run it.</p><p>All your commands will be executed automatically when the previous one finishes.</p><p>There are other programming languages you could do this in (or even VBScript) but batch would be perfectly suited to this, and you don't need to install anything extra.</p>Bali C<span>Bali C</span><div><span>23.4k</span><span aria-hidden='true'>32</span><span>32 gold badges</span><span aria-hidden='true'>99</span><span>99 silver badges</span><span aria-hidden='true'>137</span><span>137 bronze badges</span></div><p>Batch files can run a series of command line commands. Simply create a text file and name it with the <code>.bat</code> extension.</p><h3 id='sample-graduation-program-script'>Sample Graduation Program Script</h3><p>There are plenty of resources on the internet which will provide you with help.</p><div>jaypeagi<span>jaypeagi</span></div><h3 id='sample-program-script-for-emcee'>Sample Program Script For Emcee</h3><h2> Not the answer you're looking for? Browse other questions tagged windowscommand-lineexecutable or ask your own question. </h2><br><br><br><br>