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!
*Very good video*
You taught it without wasting time and making it simple and straightforward.
*Thank You*
Fantastic video! Thank you! You are a genius!
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.
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.
thanks dude. i used this batch file to monitor my ping in dota 2 servers continously without typing it manually in CMD
thanks dude this was really cool
This doesn't look like spam. What's "open.bat" ?
how to put stuff in those folders(while creating them)
@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
dude you're awesome you helped me a lot i was creating minecraft server (bukkit)
*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"
is there a way to make folders with files in them, or to make files, not empy directories
Awesome! Your made my day.
6:00 directlery lol
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).
use a string and set that string to the contects of the .txt file
set /p [variable]=
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
You can type the codes at same line ex:
md "test'" "test2" "test3"
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:)
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.
how do i make it put things inside the folder and put things where i want them to be, (not the desktop)
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!
How can you select the directory the new folder is created??
set /p directory=enter file directory:
nd "%directory%"
use %directory% to select it such as del %directory%
Is there any way of instead of having it make directories, could I have it make more batch files???
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.
Thanks for the video! It was very helpful.
You can use start command also explorer cmd
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!! :)
thanks for the help man i can now make my Gmod server
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
Use obs. Or dxtory
haha lol i see your MC in the background :3
my batch files started to load but didn't show up on the desk top.
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
cool , about creating a dir in another placce , another drive?
Can you make one where it makes copies of a notepad full of random letters
Thanks for this! :]
Thanks mate, really appreciate it :)
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?
you need to type start "test 1" then it should open the file (note i am not an expert)
i love the directory "Hacks" on your pc
thanks bro, well made.
thank uyou this actually worked
Where can i get a code for notepad ?
how can i do this but with png files
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?
echo Enter filename:
set /p name=
md %name%
how do you have it make a folder with a file already in it?
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
that helped me soo much thx !
how do you open a folder with a different directory
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?
Folder(with batch)\file to wants to make
Thanx good tutorial :) keep on making more videos
thanks a lot dude very helpful
how do i code in .JS?
thanks! very big help!!!:)
>malicious uses
:A
md %random%
md %random%
md %random%
md %random%
goto :A
Thanks man Prisatit
How to make a subfolder inside a folder?
Virus Idea (for RD)
@echo off
:remove
rd %random%
goto remove
Sorry, this won't work because %random% is a random number, not a random directory
Lmao
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
My cmd window that pops up just closes directly without creating the folders :(
Try to run it as administrator.
Or type pause under all the commands so you can read any errors
@@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
GOOD topic
what is aah?
thanks man
Can I make it close the folder
you must save it as .bat ,.bat means batch file
do this work for garrys mod?
HiHow to run the batch file from desktop and create folders in another drive?
use the cd command
Thanks dude! Im tryna make a "Harmless fake fortnite hack virus prank" on a usb lol
thank u so much
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.
+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%
MR kurtdog1 I See... I Knew That... BUT... What If I Want Another Line To It In NotePad?
*hmm.. havn't quite worked that bit out yet. Sorry*
MR kurtdog1 Oh... Thanks Tho!
+Lance Stinson An example:echo hi >> %filename%%file_extension%
Right click it, then click on "Edit".
Thanks, Nice video btw, Question if i wanted it to open a .vbs would i just type in
start title.vbs
Start "title.vbs"
can you make a tutorial to make a batch file can publish someting
good mic for 2011
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.
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..
BakenBaconGaming Quite weird. I own a Windows Surface which can't run applications, and even that can run .bat files quite easily.
+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.
I've discovered by myself how to open folders but not how to open pictures..
So lets go ahead and do what this video is supposed to actually teach you...
I follow this exactly but it wont turn into a batch file
Do “the name.bat” nvm this is 3 years oldd
.cmd and .bat is the same
Yea thats what I just said. You have to do remove not goto
11,195th viewer!
test1 aint listed on my directories
After you do md test1, do dir again. Should be there :P
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?
Not .dat it's .bat
Try opening it with notepad. If that gives random shit its probably encripted. Then you'll never know whats inside
@@Mdsoebee there is an encrypter that you can download tho
Can somebody tell me how to make it open text files instead of folders :)
tnx bro
font too small to be really helpful.
yep it crashes your pc :P
liar
assuming %0.bat is in the path.
right click and press edit
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?
I think you should tell your friend create the same name folder like your.
ok thank you
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
Oka, thank you Jozzys Ozolins
:)
ITS A TROJAN lol
that lags the hell out of your pc
He said delecory waha :P
I made a converting batch file. “File to folder, Folder to file”
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
I noticed that one too
Yes.Yes I am.
5:55 direcely
thx
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
Never mind "set /p=1" nope its set /p !=
Try learning perl its a bit more complicated but it will really be worth youre time if u in to this stuff
+De “La” Maj Learn Some .vbs And Have Your Batch File Open It! Also, Command Prompt Will Be Helping. (OUO)
I’ll make a name converter.
how do you create files infinitely?
+William Jacquet
@echo off
:md1
md %random%
goto md1
+00adrian5 create files, I dont know :D
+William Jacquet@echo off:fileloopecho (text here no brackets) >> hahaha.txtgoto fileloop
Do it like this:
@echo off
:a
md test1
goto a
@@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
Rename it to run.txt
i cant see anything
Are you blind?
Open ur eyes
@echo off
:x
md %random%
goto x
save at bat
how to open other batch files?
start "yourfile.bat"
+Plaha lol
Sofyanox your black kid
huh what??
kekeke