How To: Create a Batch File that will Create and Open Folders

  Рет қаралды 239,109

Young Media Productions

Young Media Productions

Күн бұрын

Visit my official blog! -- youngflyer12.bl...
This video serves as an introduction to creating batch files for Windows machines. My demonstration is on a Windows 7 machine, but batch files can be run on any Windows machine. Some of the commands in this video are: make directory (md), remove directory (rd), start, and @echo off. Catch many more interesting videos on my channel. Enjoy!

Пікірлер: 199
@shawnsmith1865
@shawnsmith1865 3 жыл бұрын
*Very good video* You taught it without wasting time and making it simple and straightforward. *Thank You*
@jaspercostales584
@jaspercostales584 8 жыл бұрын
thanks dude. i used this batch file to monitor my ping in dota 2 servers continously without typing it manually in CMD
@AlanCarre
@AlanCarre 11 жыл бұрын
FYI: Trailing quotes are never needed (and that principle applies to *any* console program). ex: md "test 3 and a bit more etc would create a directory with the name: "test 3 and a bit more etc" cd does not require quotes under Win7 strangely enough. Opening the current or a sub folder of current from CMD into explorer is done with the following command line: explorer %CD%\some other folder No quotes required.
@multitaskprueba1
@multitaskprueba1 3 жыл бұрын
Fantastic video! Thank you! You are a genius!
@PadySoft
@PadySoft 12 жыл бұрын
is there a way to make folders with files in them, or to make files, not empy directories
@TheDonciaMG
@TheDonciaMG 12 жыл бұрын
dude you're awesome you helped me a lot i was creating minecraft server (bukkit)
@Dewayneyork1
@Dewayneyork1 7 жыл бұрын
How would I be able to create a DOS based program for data collection? ie ( name, date, address, phone number, and things like that. so I can input the information and maybe save it like a database, but save it to the Notepad++ format. Just wondering if this would be possible. thanks in advance. God Bless.
@ArcticWolfOfficial
@ArcticWolfOfficial 8 жыл бұрын
how do you have it make a folder with a file already in it?
@gurge4420
@gurge4420 6 жыл бұрын
You cannot. BUT you can move/copy a file in the folder after the folder is created. @echo off md [folder name here] copy [file path here] .\[folder name here] exit
@jeffgray3195
@jeffgray3195 8 жыл бұрын
This is close to what I need! Any way to have a master folder with a pdf in it and have a Batch File that will create a copy, and prompt the user to name the PDF and Folder? Thanks!
@andynakpil5067
@andynakpil5067 4 жыл бұрын
hello what command shall I type on batch file when changing my host file on my pc? I normally do > OS (c:) > Windows > System32 > drivers > etc
@davidpaulseymour
@davidpaulseymour 10 жыл бұрын
thanks dude this was really cool
@Jokamutta
@Jokamutta 11 жыл бұрын
Thanx, it was for a school project what i already finished. :) I noticed u have a broken icon in ur desktop if u want i can send u a a bat code to fix it!! :)
@vikkiv3216
@vikkiv3216 3 жыл бұрын
Awesome! Your made my day.
@reloader9114
@reloader9114 4 жыл бұрын
How have I lived so long without learning how to write batch files. I want to open a program called vidcoder and I want to import all vidro files over a certain size in to that program to convert to a smaller size is that something that batch files can do.
@shawnsmith1865
@shawnsmith1865 3 жыл бұрын
*QUESTION* How do you make it open the file name with the "name(space)name" that is quoted? It creates the DIR but opens CMD Prompt, but not the folder. The Filename TEST1 works as expected without the required quotes. Anyone? *EDIT* I had to dig deep but I found it....You have to ADD in an empty pair of Quotes before the Title line. SOLUTION: start "" "Test 3"
@johnmac6682
@johnmac6682 10 жыл бұрын
How can you select the directory the new folder is created??
@endergaming7252
@endergaming7252 9 жыл бұрын
set /p directory=enter file directory: nd "%directory%" use %directory% to select it such as del %directory%
@francoisBonin-phils
@francoisBonin-phils 4 жыл бұрын
cool , about creating a dir in another placce , another drive?
@MegaSwedish1337
@MegaSwedish1337 10 жыл бұрын
When I make a batch file and try to open it, it says: "Can not find the file (C:\users...). Check that you typed the name correctly and try again" I can make the batch file and the icon changes but I cant open/use it. It has worked just fine before and just like that something has happen. If you have a clue please tell me:)
@ivandrofly
@ivandrofly 12 жыл бұрын
You can use start command also explorer cmd
@ivandrofly
@ivandrofly 12 жыл бұрын
You can type the codes at same line ex: md "test'" "test2" "test3"
@shahanshahpolonium
@shahanshahpolonium 6 жыл бұрын
how to put stuff in those folders(while creating them)
@maxmuster7003
@maxmuster7003 5 жыл бұрын
@echo off md TEST cd TEST echo We make a new text file and put this line inside.>HELLO.TXT echo And we add this line to our text file.>>HELLO.TXT dir type HELLO.TXT
@zekeluther
@zekeluther 6 жыл бұрын
Sir @Young Media Production, any idea how to read and run the program? I need the program read the names in *.txt and convert to runnable program (create user).
@Mdsoebee
@Mdsoebee 6 жыл бұрын
use a string and set that string to the contects of the .txt file set /p [variable]=
@amen2470
@amen2470 4 жыл бұрын
Can you make one where it makes copies of a notepad full of random letters
@EpixelPvP
@EpixelPvP 10 жыл бұрын
how do i make it put things inside the folder and put things where i want them to be, (not the desktop)
@adfilmworks2706
@adfilmworks2706 8 жыл бұрын
Can someone point me in the right direction to create a batch file that will allow remote users to automatically map to specific folders on a network drive once they are connected to the network remotely through vpn? Im not the best at programming but i admit I ought to know it. My remote users always complain that their mapped network drives are dropped once they are remote. When they are on the network they are able to connect automatically but I want to be able to give them the option of running a batch file on their desktop that will automatically map their network drives. Thanks in advance
@eplnews4272
@eplnews4272 8 жыл бұрын
thanks for the help man i can now make my Gmod server
@PigLoveMinecraft
@PigLoveMinecraft 11 жыл бұрын
Since your comment is 5 months old you might not find this useful, but you'll need to change the directory to the main folder and then make a directory inside of it. Code that could be used: cd "(mainfoldername)" md "(subfoldername)" That should work.
@pokemaster1561
@pokemaster1561 7 жыл бұрын
i love the directory "Hacks" on your pc
@AlanCarre
@AlanCarre 11 жыл бұрын
This doesn't look like spam. What's "open.bat" ?
@AshleyGlover
@AshleyGlover 7 жыл бұрын
Is there a command I can use so that the end user could in put the project name within CMD prompt when the batch file is run?
@Mdsoebee
@Mdsoebee 6 жыл бұрын
echo Enter filename: set /p name= md %name%
@potatoman1833
@potatoman1833 11 жыл бұрын
Hey bud, i'm trying really hard to learn batch file so i'm here to ask you a question, how do you make the folder so you can create a folder in another location instead of the location the batch is?
@FLOWER0914
@FLOWER0914 2 жыл бұрын
Folder(with batch)\file to wants to make
@scaprod558
@scaprod558 9 жыл бұрын
I Want To Make A Fully-Functional Batch File Which Installs A Few Files Then Deletes The Batch File That Made The Files For Your PC, Not The Batch File That Ran The Installer. Also Like Making A .txt File Which Has Words In It. Is That Possible? I Would Like To Know.
@MRkurtdog1
@MRkurtdog1 9 жыл бұрын
+Lance Stinson Hii have made a batch file for u just copy and paste this: @echo off title File Maker set /p name=Please enter the file name: set /p ext=Please enter the file extention(e.g. .bat or .txt): set /p con=Please enter the contents of the file(You don't have to this bit): echo %con% > %name%.%ext%
@scaprod558
@scaprod558 9 жыл бұрын
MR kurtdog1 I See... I Knew That... BUT... What If I Want Another Line To It In NotePad?
@MRkurtdog1
@MRkurtdog1 9 жыл бұрын
*hmm.. havn't quite worked that bit out yet. Sorry*
@scaprod558
@scaprod558 9 жыл бұрын
MR kurtdog1 Oh... Thanks Tho!
@jazzyboxer
@jazzyboxer 9 жыл бұрын
+Lance Stinson An example:echo hi >> %filename%%file_extension%
@RyanJohnsonD
@RyanJohnsonD 10 жыл бұрын
I am getting unexpected results.The Command prompt opens when I run start "test 1". How do you get a folder to open that have spaces?
@cykacat4196
@cykacat4196 10 жыл бұрын
you need to type start "test 1" then it should open the file (note i am not an expert)
@lachie9922
@lachie9922 10 жыл бұрын
Thanks for the video! It was very helpful.
@nicholasghostpachis2302
@nicholasghostpachis2302 12 жыл бұрын
Where can i get a code for notepad ?
@bipinzacharia706
@bipinzacharia706 6 жыл бұрын
HiHow to run the batch file from desktop and create folders in another drive?
@Mdsoebee
@Mdsoebee 6 жыл бұрын
use the cd command
@LUX1111111111111
@LUX1111111111111 10 жыл бұрын
thanks a lot dude very helpful
@stormteam9028
@stormteam9028 3 жыл бұрын
how do i code in .JS?
@DanielRobboSon
@DanielRobboSon 9 жыл бұрын
6:00 directlery lol
@guliyevshahriyar
@guliyevshahriyar 9 жыл бұрын
thanks bro, well made.
@togglemutt9892
@togglemutt9892 8 жыл бұрын
my batch files started to load but didn't show up on the desk top.
@cjbeans
@cjbeans 8 жыл бұрын
how do i do this with other files?
@TheMaccywaccy
@TheMaccywaccy 11 жыл бұрын
how do you open a folder with a different directory
@TheSoundbar
@TheSoundbar 5 жыл бұрын
that helped me soo much thx !
@196MXRider
@196MXRider 11 жыл бұрын
what program do you use to screen record on your computer because i have a HP with windows 7 so plz help me out if you can and also i got a few other questions
@1tickrs
@1tickrs 9 жыл бұрын
Use obs. Or dxtory
@zombieshoe
@zombieshoe 12 жыл бұрын
Is there any way of instead of having it make directories, could I have it make more batch files???
@bakenbacongaming4255
@bakenbacongaming4255 10 жыл бұрын
my computer doesn't let me open .bat files. It says I don't have the software to run that file. I use windows 8.
@bp7901
@bp7901 9 жыл бұрын
That's strange because I opend my batch files on windows 8 when I write code. What's more strange is that this is windows..
@Prominator123
@Prominator123 9 жыл бұрын
BakenBaconGaming Quite weird. I own a Windows Surface which can't run applications, and even that can run .bat files quite easily.
@shaitellez1253
@shaitellez1253 9 жыл бұрын
+BakenBaconGaming if you still havent got it worked out, try opening a .cmd file. It's basically the same thing, but it uses a 32-bit instruction set instead of a 16-bit one.
@dragonoiddragondemon
@dragonoiddragondemon 6 жыл бұрын
Can I make it close the folder
@liammacdonald7061
@liammacdonald7061 7 жыл бұрын
thank uyou this actually worked
@thatotherpersonkaz5941
@thatotherpersonkaz5941 11 жыл бұрын
Thanks, Nice video btw, Question if i wanted it to open a .vbs would i just type in start title.vbs
@1tickrs
@1tickrs 9 жыл бұрын
Start "title.vbs"
@hedleyr666
@hedleyr666 9 жыл бұрын
Thanks mate, really appreciate it :)
@neviemnic3633
@neviemnic3633 7 жыл бұрын
Thanks man Prisatit
@jelaucs
@jelaucs 10 жыл бұрын
do this work for garrys mod?
@xKitKit
@xKitKit 5 жыл бұрын
Thanks for this! :]
@StrikiGaming
@StrikiGaming 6 ай бұрын
good mic for 2011
@anishjagannathan1576
@anishjagannathan1576 7 жыл бұрын
Can someone tell me how I could open a save.dat file? Like I do @echo off start save.dat But it doesn't work and gives a error message saying Windows cannot find 'save.dat'. Make sure you typed in the name correctly. In this game I have, I want to know my OWN password. Im guessing it's in the save.dat file. I tried opening it from the file location, but I can't get that to work. So I went here. And the steps above happens. Any help?
@amilasudarshana3393
@amilasudarshana3393 7 жыл бұрын
Not .dat it's .bat
@Mdsoebee
@Mdsoebee 6 жыл бұрын
Try opening it with notepad. If that gives random shit its probably encripted. Then you'll never know whats inside
@ananemy7517
@ananemy7517 2 жыл бұрын
@@Mdsoebee there is an encrypter that you can download tho
@kgonzales8592
@kgonzales8592 11 жыл бұрын
you must save it as .bat ,.bat means batch file
@storken756
@storken756 6 жыл бұрын
My cmd window that pops up just closes directly without creating the folders :(
@Mdsoebee
@Mdsoebee 6 жыл бұрын
Try to run it as administrator. Or type pause under all the commands so you can read any errors
@ananemy7517
@ananemy7517 2 жыл бұрын
@@Mdsoebee if he doesnt have admin, he could use loophole like i do. it just: >cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" %1"< But i think everyone knows about this now
@creasu124
@creasu124 8 жыл бұрын
can you make a tutorial to make a batch file can publish someting
@austinchong
@austinchong 11 жыл бұрын
thanks! very big help!!!:)
@notsoproxd3642
@notsoproxd3642 4 жыл бұрын
Thanks dude! Im tryna make a "Harmless fake fortnite hack virus prank" on a usb lol
@oisinkelly3165
@oisinkelly3165 2 жыл бұрын
thanks man
@ivandrofly
@ivandrofly 12 жыл бұрын
GOOD topic
@Dantheman6074
@Dantheman6074 12 жыл бұрын
That would not work bro, you would need to have it like this @echo off :remove cls(optional) 1.remove set /p number= if %number% == 1 del (your program and program directory) because if you do goto remove you need to make a :remove cell script
@Dantheman6074
@Dantheman6074 12 жыл бұрын
Yea thats what I just said. You have to do remove not goto
@Jokamutta
@Jokamutta 12 жыл бұрын
How to make a subfolder inside a folder?
@warbearin
@warbearin 12 жыл бұрын
what is aah?
@xTheDrivingMonkeyx
@xTheDrivingMonkeyx 11 жыл бұрын
Anyone can help? I want to give this program to a friend, but it have to open a folder in C:\Users\Kristoffer\Desktop\Gadget but hes computer dont have the name Kristoffer What shal i do?
@depo6512
@depo6512 11 жыл бұрын
I think you should tell your friend create the same name folder like your.
@xTheDrivingMonkeyx
@xTheDrivingMonkeyx 11 жыл бұрын
ok thank you
@Jozolins
@Jozolins 11 жыл бұрын
Do echo off start C:\Users\%USERNAME%\Desktop\Gadget but he need to have a Gadget folder on the desktop :) any more questions ask me at skype ansisjanisozo
@xTheDrivingMonkeyx
@xTheDrivingMonkeyx 11 жыл бұрын
Oka, thank you Jozzys Ozolins :)
@魔法の剣-y4g
@魔法の剣-y4g 11 жыл бұрын
Thanx good tutorial :) keep on making more videos
@kihembokiiza9429
@kihembokiiza9429 9 жыл бұрын
test1 aint listed on my directories
@forjever2576
@forjever2576 9 жыл бұрын
After you do md test1, do dir again. Should be there :P
@plaha2646
@plaha2646 9 жыл бұрын
how to open other batch files?
@daamezinspederman1748
@daamezinspederman1748 9 жыл бұрын
start "yourfile.bat"
@sofyanox12
@sofyanox12 9 жыл бұрын
+Plaha lol
@plaha2646
@plaha2646 9 жыл бұрын
Sofyanox your black kid
@sofyanox12
@sofyanox12 9 жыл бұрын
huh what??
@daamezinspederman1748
@daamezinspederman1748 9 жыл бұрын
kekeke
@ltngboltz
@ltngboltz 7 жыл бұрын
I follow this exactly but it wont turn into a batch file
@BloonPlays
@BloonPlays 4 жыл бұрын
Do “the name.bat” nvm this is 3 years oldd
@Cheeseyguymark2
@Cheeseyguymark2 12 жыл бұрын
So lets go ahead and do what this video is supposed to actually teach you...
@henryshoreman2679
@henryshoreman2679 12 жыл бұрын
Virus Idea (for RD) @echo off :remove rd %random% goto remove
@flyingmaster9744
@flyingmaster9744 4 жыл бұрын
Sorry, this won't work because %random% is a random number, not a random directory
@SKETCHB0OK
@SKETCHB0OK 3 жыл бұрын
Lmao
@Magpie-wo3vt
@Magpie-wo3vt 6 жыл бұрын
I can use a file like this to lag the crap out of the next computer, if I place it in the log on folder :D
@darwinthehotdog5587
@darwinthehotdog5587 8 жыл бұрын
Can somebody tell me how to make it open text files instead of folders :)
@Hi.GuysBs
@Hi.GuysBs 4 жыл бұрын
.cmd and .bat is the same
@fornsphin
@fornsphin 11 жыл бұрын
Right click it, then click on "Edit".
@denaj2115
@denaj2115 5 жыл бұрын
thank u so much
@dudeglasses2147
@dudeglasses2147 9 жыл бұрын
how do you create files infinitely?
@00adrian5
@00adrian5 9 жыл бұрын
+William Jacquet @echo off :md1 md %random% goto md1
@00adrian5
@00adrian5 9 жыл бұрын
+00adrian5 create files, I dont know :D
@creasu124
@creasu124 9 жыл бұрын
+William Jacquet@echo off:fileloopecho (text here no brackets) >> hahaha.txtgoto fileloop
@YoulooDingDongKenth
@YoulooDingDongKenth 8 жыл бұрын
Do it like this: @echo off :a md test1 goto a
@Mdsoebee
@Mdsoebee 6 жыл бұрын
@@00adrian5 better to do %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random% Then it will be litterally infinite
@henkiespenkie4414
@henkiespenkie4414 10 жыл бұрын
tnx bro
@MrTurd1337
@MrTurd1337 11 жыл бұрын
>malicious uses :A md %random% md %random% md %random% md %random% goto :A
@themovercell2318
@themovercell2318 3 жыл бұрын
I made a converting batch file. “File to folder, Folder to file”
@demaj6047
@demaj6047 10 жыл бұрын
Can you help me I'm trying to make a "batch menu" for fun here's the code dont judge please help,the error is goto was unexpected @echo off :home echo Welcome to the De Maj Batch Menu! echo Please choose an option to procede echo ------------------------------------------------ echo 1)Trivia echo 2)Make a New Folder set /p=! if %!% == 1 goto Trivia if %!% == 2 goto Doc :Doc echo The folder will be named "Folder" I can't do anything about this at this time and I'll edit the code so that you can name it within the Batch Menu,To change the folder's name right click it,then click rename pause md Folder pause goto home
@demaj6047
@demaj6047 10 жыл бұрын
Never mind "set /p=1" nope its set /p !=
@billcosby-cp4wm
@billcosby-cp4wm 9 жыл бұрын
Try learning perl its a bit more complicated but it will really be worth youre time if u in to this stuff
@scaprod558
@scaprod558 9 жыл бұрын
+De “La” Maj Learn Some .vbs And Have Your Batch File Open It! Also, Command Prompt Will Be Helping. (OUO)
@seriosuico
@seriosuico 12 жыл бұрын
I've discovered by myself how to open folders but not how to open pictures..
@ETcips
@ETcips 12 жыл бұрын
I noticed that one too
@ComputerGold152
@ComputerGold152 12 жыл бұрын
right click and press edit
@FusionDoomSkull
@FusionDoomSkull 12 жыл бұрын
haha lol i see your MC in the background :3
@Phleemflam
@Phleemflam 6 жыл бұрын
thx
@AlanCarre
@AlanCarre 11 жыл бұрын
assuming %0.bat is in the path.
@didyouknow8820
@didyouknow8820 6 жыл бұрын
Yes.Yes I am.
@yakmanok
@yakmanok 12 жыл бұрын
font too small to be really helpful.
@cdmaster992
@cdmaster992 5 жыл бұрын
6:00 direcly
@nvxq
@nvxq 4 жыл бұрын
@echo off :x md %random% goto x save at bat
@themovercell2318
@themovercell2318 3 жыл бұрын
I’ll make a name converter.
@joefloppytriangle
@joefloppytriangle 8 жыл бұрын
5:55 direcely
@CyberHackNet
@CyberHackNet 11 жыл бұрын
11,195th viewer!
@kdf0021
@kdf0021 7 жыл бұрын
instead of goign to new then new document open notepad
@Mdsoebee
@Mdsoebee 6 жыл бұрын
start C:\windows\system32 otepad.txt
@ETcips
@ETcips 12 жыл бұрын
He said delecory waha :P
@georgeserkedakhs8336
@georgeserkedakhs8336 10 жыл бұрын
well thanx i guess but i cant see anything
@bantam316
@bantam316 11 жыл бұрын
yep it crashes your pc :P
@climpuright
@climpuright 5 жыл бұрын
liar
Linux File System/Structure Explained!
15:59
DorianDotSlash
Рет қаралды 4,3 МЛН
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Beginner's Guide to the Bash Terminal
1:14:37
Joe Collins (EzeeLinux)
Рет қаралды 2,3 МЛН
Password Cracker with Notepad!
11:41
ebola man
Рет қаралды 842 М.
Write your own Operating System in 1 hour
54:56
Write your own Operating System
Рет қаралды 527 М.
I Spent 100 Hours Inside The Pyramids!
21:43
MrBeast
Рет қаралды 22 МЛН
Windows Tricks With Scripts
6:15
CHM Tech
Рет қаралды 880 М.
Running a Buffer Overflow Attack - Computerphile
17:30
Computerphile
Рет қаралды 2 МЛН
How does a USB keyboard work?
34:15
Ben Eater
Рет қаралды 3,4 МЛН
Бат файлы: основные команды, примеры
20:05
Invizor GameAndCode
Рет қаралды 26 М.
Free Drive Cloning Applications
18:19
ExplainingComputers
Рет қаралды 374 М.
How to Create a Batch (.bat) File in Windows
5:02
Websplaining
Рет қаралды 184 М.
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН