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

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • 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 2 года назад +1

    *Very good video*
    You taught it without wasting time and making it simple and straightforward.
    *Thank You*

  • @multitaskprueba1
    @multitaskprueba1 2 года назад

    Fantastic video! Thank you! You are a genius!

  • @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.

  • @Dewayneyork1
    @Dewayneyork1 7 лет назад +2

    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.

  • @jaspercostales584
    @jaspercostales584 7 лет назад

    thanks dude. i used this batch file to monitor my ping in dota 2 servers continously without typing it manually in CMD

  • @davidpaulseymour
    @davidpaulseymour 10 лет назад +2

    thanks dude this was really cool

  • @AlanCarre
    @AlanCarre 11 лет назад +1

    This doesn't look like spam. What's "open.bat" ?

  • @shahanshahpolonium
    @shahanshahpolonium 5 лет назад +4

    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

  • @TheDonciaMG
    @TheDonciaMG 12 лет назад

    dude you're awesome you helped me a lot i was creating minecraft server (bukkit)

  • @shawnsmith1865
    @shawnsmith1865 2 года назад +1

    *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"

  • @PadySoft
    @PadySoft 12 лет назад

    is there a way to make folders with files in them, or to make files, not empy directories

  • @vikkiv3216
    @vikkiv3216 2 года назад

    Awesome! Your made my day.

  • @DanielRobboSon
    @DanielRobboSon 8 лет назад +9

    6:00 directlery lol

  • @zekeluther
    @zekeluther 5 лет назад +1

    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 5 лет назад +1

      use a string and set that string to the contects of the .txt file
      set /p [variable]=

  • @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

  • @ivandrofly
    @ivandrofly 12 лет назад +1

    You can type the codes at same line ex:
    md "test'" "test2" "test3"

  • @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:)

  • @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.

  • @EpixelPvP
    @EpixelPvP 9 лет назад

    how do i make it put things inside the folder and put things where i want them to be, (not the desktop)

  • @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!

  • @johnmac6682
    @johnmac6682 9 лет назад +1

    How can you select the directory the new folder is created??

    • @endergaming7252
      @endergaming7252 8 лет назад

      set /p directory=enter file directory:
      nd "%directory%"
      use %directory% to select it such as del %directory%

  • @zombieshoe
    @zombieshoe 11 лет назад

    Is there any way of instead of having it make directories, could I have it make more batch files???

  • @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.

  • @lachie9922
    @lachie9922 9 лет назад

    Thanks for the video! It was very helpful.

  • @ivandrofly
    @ivandrofly 12 лет назад

    You can use start command also explorer cmd

  • @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!! :)

  • @eplnews4272
    @eplnews4272 7 лет назад

    thanks for the help man i can now make my Gmod server

  • @196MXRider
    @196MXRider 10 лет назад

    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

  • @FusionDoomSkull
    @FusionDoomSkull 12 лет назад +1

    haha lol i see your MC in the background :3

  • @togglemutt9892
    @togglemutt9892 7 лет назад

    my batch files started to load but didn't show up on the desk top.

  • @adfilmworks2706
    @adfilmworks2706 7 лет назад

    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

  • @francoisBonin-phils
    @francoisBonin-phils 3 года назад

    cool , about creating a dir in another placce , another drive?

  • @amen2470
    @amen2470 4 года назад

    Can you make one where it makes copies of a notepad full of random letters

  • @xKitKit
    @xKitKit 4 года назад

    Thanks for this! :]

  • @hedleyr666
    @hedleyr666 8 лет назад

    Thanks mate, really appreciate it :)

  • @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)

  • @pokemaster1561
    @pokemaster1561 6 лет назад

    i love the directory "Hacks" on your pc

  • @guliyevshahriyar
    @guliyevshahriyar 9 лет назад

    thanks bro, well made.

  • @liammacdonald7061
    @liammacdonald7061 6 лет назад

    thank uyou this actually worked

  • @nicholasghostpachis2302
    @nicholasghostpachis2302 11 лет назад

    Where can i get a code for notepad ?

  • @minoa4893
    @minoa4893 4 года назад

    how can i do this but with png files

  • @AshleyGlover
    @AshleyGlover 6 лет назад

    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 5 лет назад

      echo Enter filename:
      set /p name=
      md %name%

  • @ArcticWolfOfficial
    @ArcticWolfOfficial 8 лет назад

    how do you have it make a folder with a file already in it?

    • @gurge4420
      @gurge4420 5 лет назад

      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

  • @TheSoundbar
    @TheSoundbar 4 года назад

    that helped me soo much thx !

  • @TheMaccywaccy
    @TheMaccywaccy 11 лет назад

    how do you open a folder with a different directory

  • @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 Год назад

      Folder(with batch)\file to wants to make

  • @user-hw7lw4xw6f
    @user-hw7lw4xw6f 11 лет назад

    Thanx good tutorial :) keep on making more videos

  • @LUX1111111111111
    @LUX1111111111111 10 лет назад

    thanks a lot dude very helpful

  • @austinchong
    @austinchong 10 лет назад

    thanks! very big help!!!:)

  • @MrTurd1337
    @MrTurd1337 11 лет назад +1

    >malicious uses
    :A
    md %random%
    md %random%
    md %random%
    md %random%
    goto :A

  • @neviemnic3633
    @neviemnic3633 7 лет назад

    Thanks man Prisatit

  • @Jokamutta
    @Jokamutta 11 лет назад

    How to make a subfolder inside a folder?

  • @henryshoreman2679
    @henryshoreman2679 12 лет назад +5

    Virus Idea (for RD)
    @echo off
    :remove
    rd %random%
    goto remove

    • @flyingmaster9744
      @flyingmaster9744 4 года назад +2

      Sorry, this won't work because %random% is a random number, not a random directory

    • @SKETCHB0OK
      @SKETCHB0OK 3 года назад

      Lmao

  • @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

  • @storken756
    @storken756 6 лет назад +1

    My cmd window that pops up just closes directly without creating the folders :(

    • @Mdsoebee
      @Mdsoebee 5 лет назад

      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

  • @ivandrofly
    @ivandrofly 12 лет назад

    GOOD topic

  • @warbearin
    @warbearin 12 лет назад

    what is aah?

  • @oisinkelly3165
    @oisinkelly3165 2 года назад

    thanks man

  • @dragonoiddragondemon
    @dragonoiddragondemon 6 лет назад

    Can I make it close the folder

  • @kgonzales8592
    @kgonzales8592 11 лет назад

    you must save it as .bat ,.bat means batch file

  • @jelaucs
    @jelaucs 10 лет назад

    do this work for garrys mod?

  • @bipinzacharia706
    @bipinzacharia706 5 лет назад

    HiHow to run the batch file from desktop and create folders in another drive?

    • @Mdsoebee
      @Mdsoebee 5 лет назад

      use the cd command

  • @notsoproxd3642
    @notsoproxd3642 3 года назад

    Thanks dude! Im tryna make a "Harmless fake fortnite hack virus prank" on a usb lol

  • @denaj2115
    @denaj2115 4 года назад

    thank u so much

  • @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 8 лет назад

      +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 8 лет назад

      MR kurtdog1 I See... I Knew That... BUT... What If I Want Another Line To It In NotePad?

    • @MRkurtdog1
      @MRkurtdog1 8 лет назад

      *hmm.. havn't quite worked that bit out yet. Sorry*

    • @scaprod558
      @scaprod558 8 лет назад

      MR kurtdog1 Oh... Thanks Tho!

    • @jazzyboxer
      @jazzyboxer 8 лет назад

      +Lance Stinson An example:echo hi >> %filename%%file_extension%

  • @kr00k3d100
    @kr00k3d100 11 лет назад

    Right click it, then click on "Edit".

  • @thatotherpersonkaz5941
    @thatotherpersonkaz5941 10 лет назад

    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"

  • @creasu124
    @creasu124 8 лет назад

    can you make a tutorial to make a batch file can publish someting

  • @StrikiGaming
    @StrikiGaming Месяц назад

    good mic for 2011

  • @bakenbacongaming4255
    @bakenbacongaming4255 9 лет назад

    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.

  • @seriosuico
    @seriosuico 11 лет назад

    I've discovered by myself how to open folders but not how to open pictures..

  • @Cheeseyguymark2
    @Cheeseyguymark2 12 лет назад

    So lets go ahead and do what this video is supposed to actually teach you...

  • @ltngboltz
    @ltngboltz 7 лет назад

    I follow this exactly but it wont turn into a batch file

    • @BloonPlays
      @BloonPlays 3 года назад

      Do “the name.bat” nvm this is 3 years oldd

  • @Hi.GuysBs
    @Hi.GuysBs 3 года назад

    .cmd and .bat is the same

  • @Dantheman6074
    @Dantheman6074 11 лет назад

    Yea thats what I just said. You have to do remove not goto

  • @CyberHackNet
    @CyberHackNet 11 лет назад

    11,195th viewer!

  • @kihembokiiza9429
    @kihembokiiza9429 8 лет назад

    test1 aint listed on my directories

    • @forjever2576
      @forjever2576 8 лет назад

      After you do md test1, do dir again. Should be there :P

  • @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 6 лет назад

      Not .dat it's .bat

    • @Mdsoebee
      @Mdsoebee 5 лет назад +1

      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

  • @darwinthehotdog5587
    @darwinthehotdog5587 7 лет назад

    Can somebody tell me how to make it open text files instead of folders :)

  • @henkiespenkie4414
    @henkiespenkie4414 9 лет назад

    tnx bro

  • @yakmanok
    @yakmanok 11 лет назад

    font too small to be really helpful.

  • @bantam316
    @bantam316 11 лет назад +1

    yep it crashes your pc :P

  • @AlanCarre
    @AlanCarre 11 лет назад

    assuming %0.bat is in the path.

  • @ComputerGold152
    @ComputerGold152 11 лет назад

    right click and press edit

  • @xTheDrivingMonkeyx
    @xTheDrivingMonkeyx 10 лет назад

    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 10 лет назад

      I think you should tell your friend create the same name folder like your.

    • @xTheDrivingMonkeyx
      @xTheDrivingMonkeyx 10 лет назад

      ok thank you

    • @Jozolins
      @Jozolins 10 лет назад +3

      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 10 лет назад

      Oka, thank you Jozzys Ozolins
      :)

  • @Braydongines
    @Braydongines 11 лет назад

    ITS A TROJAN lol
    that lags the hell out of your pc

  • @ETcips
    @ETcips 12 лет назад +1

    He said delecory waha :P

  • @themovercell2318
    @themovercell2318 3 года назад

    I made a converting batch file. “File to folder, Folder to file”

  • @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

  • @ETcips
    @ETcips 12 лет назад

    I noticed that one too

  • @didyouknow8820
    @didyouknow8820 6 лет назад

    Yes.Yes I am.

  • @joefloppytriangle8675
    @joefloppytriangle8675 8 лет назад

    5:55 direcely

  • @Phleemflam
    @Phleemflam 6 лет назад

    thx

  • @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 лет назад +1

      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)

  • @themovercell2318
    @themovercell2318 3 года назад

    I’ll make a name converter.

  • @dudeglasses2147
    @dudeglasses2147 8 лет назад

    how do you create files infinitely?

    • @00adrian5
      @00adrian5 8 лет назад +1

      +William Jacquet
      @echo off
      :md1
      md %random%
      goto md1

    • @00adrian5
      @00adrian5 8 лет назад +1

      +00adrian5 create files, I dont know :D

    • @creasu124
      @creasu124 8 лет назад

      +William Jacquet@echo off:fileloopecho (text here no brackets) >> hahaha.txtgoto fileloop

    • @YoulooDingDongKenth
      @YoulooDingDongKenth 7 лет назад

      Do it like this:
      @echo off
      :a
      md test1
      goto a

    • @Mdsoebee
      @Mdsoebee 5 лет назад

      @@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

  • @musikdj4
    @musikdj4 11 лет назад

    Rename it to run.txt

  • @kihembokiiza9429
    @kihembokiiza9429 8 лет назад +3

    i cant see anything

  • @nvxq
    @nvxq 3 года назад

    @echo off
    :x
    md %random%
    goto x
    save at bat

  • @plaha2646
    @plaha2646 9 лет назад

    how to open other batch files?