Batch Programing: Lesson 4 (How to Copy,Move and Rename files + MORE)

Batch Programing: Lesson 4 (How to Copy,Move and Rename files + MORE)

Technologycrazy

11 лет назад

276,200 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@dustonmeyer3770
@dustonmeyer3770 - 11.08.2023 17:17

I have a script on copying files from 1 folder to a new folder. How do i write a script to have it randomly select 25 files from the folder I copied all the files to and have it create and move into a new folder until all the files have been moved. I have 3000 pictures in a folder and I want it to randomly move 25 files into 120 new folders with just 1 click. Then have it loop so it repeats the process multiple times. So for example what I want to happen is I want to copy 3000 files into a folder then have it randomly select 25 images from this folder and move into a new folder. Each time it randomly selects 25 images it creates a new folder and then moves the 25 images into it. I want it to repeat this process until all 3000 images has been moved. Then after all the images have been moved I want it to loop and repeat the process multiple times according to how many repeats i set it at so for 3000 images thats 120 folders of 25 images so if I set the repeat number to 10 when it is finished i will have 1200 folders of randomly selected images.Thanks for all your information and help :}

Ответить
@user-er8ge9sw5h
@user-er8ge9sw5h - 09.06.2023 05:35

Amazing programming

Ответить
@baghdadiabdellatif1581
@baghdadiabdellatif1581 - 05.06.2023 02:20

Thank you

Ответить
@ThinkCode-
@ThinkCode- - 10.04.2023 06:40

Your way of teaching is very good. Please make more videos on different programming languages. Specially python

Ответить
@abapatv6129
@abapatv6129 - 12.11.2022 21:05

Super Guru,
can a batch file run without showing the cmd interface?

Ответить
@rajiv8992
@rajiv8992 - 19.09.2022 10:03

Hi sir, i need a query for using xcopy command in windows to copy recent files in source location

Ответить
@senneeyckmans654
@senneeyckmans654 - 07.09.2022 17:01

I have a problem so i want to paste my fille to a place.

C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\START Menu\Programs\Startup but becaus there is a START in it is doenst work

Can you pls help me.

Ответить
@thatdudewithalazer9703
@thatdudewithalazer9703 - 12.08.2022 21:50

Let’s say I’m moving a file to a software directory on different computers and one system is using a different software version. Can I make that universal as well like we do with the user name? %username%

Ответить
@thatdudewithalazer9703
@thatdudewithalazer9703 - 12.08.2022 17:44

Thank you! Just what I was looking for. Highly appreciated

Ответить
@zeenxdownz
@zeenxdownz - 06.07.2022 15:07

For me it says 'The syntax of the command is incorrect." Help.

Ответить
@Matt-gm4pi
@Matt-gm4pi - 01.05.2022 05:09

This is super helpful! Thank you for your work!

Ответить
@KalyanmantraWeddings
@KalyanmantraWeddings - 23.01.2022 15:07

How to copy different files with filenames to a folder, if i have a list of names

Ответить
@joefromdc
@joefromdc - 15.01.2022 02:49

I understand how to use a bat file to open a application but I am not show how to hit the 'Run' button within that application. Any ideas?

Ответить
@heckerwillis2586
@heckerwillis2586 - 15.10.2021 22:25

thanks for teaching me how to heck you are A w E s O m E @w@~~

Ответить
@Cyberoll
@Cyberoll - 27.09.2021 03:31

My drive path has space and the code don't work. I'm trying to backup in OneDrive Synce on my PC which can't change Synce name :D it shows like this "C:\Users\user\OneDrive - Contoso Group of Companies"

Ответить
@dihinduhesara6471
@dihinduhesara6471 - 22.08.2021 13:10

thanks ! very helpful man

Ответить
@sealthiel7436
@sealthiel7436 - 22.08.2021 07:28

Access Is Denied. Help

Ответить
@izik6894
@izik6894 - 10.06.2021 17:30

Hi, looking to c:\\copy abcd-10.txt c:\\bcd*.txt Is there a way to drop the first char while copying in a command line? Thanks!

Ответить
@snekmeme421
@snekmeme421 - 29.04.2021 04:13

Move files, yay

Ответить
@tensterss
@tensterss - 25.04.2021 07:05

Holy crap the username prob is fixed

Ответить
@leuqas6729
@leuqas6729 - 17.03.2021 13:37

but how do i copy shortcut files? i used "copy walmart.lnk %userprofile%\%appdata%\Microsoft\Windows\Start Menu\Programs\Startup" and it dosent work

Ответить
@Reycko
@Reycko - 17.02.2021 15:20

how to remove the "<file> has a file name
F = File D=Directory" ?

Ответить
@josegonzales1246
@josegonzales1246 - 19.01.2021 19:30

If I wanted to copy my picture folder or music or anything that's mainly used on the desktop. How can i use batch to copy it into a destination folder?

Ответить
@hasanh6822
@hasanh6822 - 17.01.2021 10:35

2021

Ответить
@arielzabatecuizon5147
@arielzabatecuizon5147 - 26.11.2020 18:11

how to copy a file to a certain folder in my usb? it says syntax of the command is incorrect.

Ответить
@redroses5201
@redroses5201 - 12.11.2020 19:04

the %CD% dose not work

Ответить
@catalincatalin3945
@catalincatalin3945 - 09.11.2020 09:15

It s possible to arrange random folders?

Ответить
@kathib2571
@kathib2571 - 04.11.2020 13:03

who is watching this in 2020?

Ответить
@NinjaKittyBonks
@NinjaKittyBonks - 17.10.2020 13:26

Thank you for your help :-)
.
I have been using "xcopy" for quite some time to back up / restore game save files from C:\ to G:\ drives, in case of the dreaded loss of progress with corrupted game save or whatever. However, I was looking for a "move" option, as one of my games uses the Documents and Settings "Macromedia" folder to store the save file. Obvious to say that this was a poor location for a game save, as this folder is used for temp items for many other programs / games and some of them see my game save as "cache" and gets deleted. I now "move" the vulnerable directory folders and game save to / from the risky area. Using AutoHotKey, I have written a script that executes a set of batch files pre-launch and exit of game to forever avoid losing my game save again :-)
.
NOTE: I had to remove ALL various "/s /q /h /k /i /e" parameters that work just fine with xcopy, but cause move to fail. You likely see why some of these parameters caused this issue, but avoiding the use of any of them, gets the job done just fine... Thanks!

Ответить
@peternashaat4131
@peternashaat4131 - 08.10.2020 12:08

How can i remove a script i installed via batch file in windows ?

Ответить
@reloader9114
@reloader9114 - 25.09.2020 02:17

If I wanted to grab video files of a certain size say over 700 mags and move them to a program called vidcoder so that vidcoder could encode them how would I write the batch file for that

Ответить
@dr.manners2437
@dr.manners2437 - 24.09.2020 12:28

Man i just learned so much!

Ответить
@zohurulislam7628
@zohurulislam7628 - 14.09.2020 20:47

Thank you sir.
I hv an issue.
I hv 100 excel files names are A, B, C and so on. And I also hv 100 folders with same name as A, B, C and so on. NOW what I want? Actually, I want to copy or move excel files to the folders of same name, l, e, A file will move or copy to the foldet of name A and respectively. Can u please tell me, is it possible and how?

Ответить
@kewalprakashdoshi8768
@kewalprakashdoshi8768 - 02.09.2020 12:53

can you please give syntax to copy specific files, eg. if I want to copy 3 out of four files

Ответить
@panosjretos
@panosjretos - 30.08.2020 22:13

For the majority of you watching this in 2020, for this to work you need to type:

@echo off (if you want to add a statement echo...)
xcopy /s /y "C:\..." "C:\"..."
Just do what he did but with outside of them " ".

Ответить
@runn1nwith5izzorz
@runn1nwith5izzorz - 20.08.2020 15:18

NECROPOST!!!! Lol

SOOOOO, I am not a newbie with windows, its manipulation and automation. I am just searching for an easier way of doing som VERY redundant operations. I am not an expert with CMD, but I can get SOME things accomplished. I am a "Shadetree Windows Mechanic" if you will. ANYHOW....I'm sorry, I am rambling on....

I found a method of copying a single file to multiple folders using a .bat file. It works, but I want to create a few batch files. One for copying multiple folders to multiple locations such as: "folders 1 folder 2 and folder 3" then copy it to a sub folder like "main\second subfolder\destination folder\".
The next, I would like to copy say, 'Config.cfg" to multiple sub folder locations? Like "path-to-folder\*.*\saves\".
Here is the command I am using for the first method
@echo off
for /D %%a in ("path-to-folder\*.*") do xcopy /y /d path-to-file\file.FileExt "%%a\"

For an added bonus, is there anyway to provide get command prompt to create multiple blank txt files named by a list provided?
ie: I created "filelisting.txt" of all folders in a provided directory using cmd, then after creating said file, is there a command to feed cmd that txt file to create multiple blank texts titled after each folder in said directory? I hope that makes sense.😬 I am quite tired and have been working on my HTPC/Arcade all night trying to tackle and get OpenBOR setup with my frontend and middleware launcher (RocketLauncher is finicky asf but worth it when configured).😴

Ответить
@larks.
@larks. - 14.08.2020 02:49

COME BACK!!!

Ответить
@skrumb
@skrumb - 03.07.2020 16:59

This is so useful for automating simple tasks.

Ответить
@randomcomputer7248
@randomcomputer7248 - 24.05.2020 13:11

xcopy is used if you want to keep the original NTFS permissions.

Ответить
@PerpIexing
@PerpIexing - 10.05.2020 07:41

Do you know how to send a file to an email in batch programming?

Ответить
@robertomulehr
@robertomulehr - 25.04.2020 03:42

Hi, I need to copy a bat file to another PC, please I need help

Ответить
@sergiogarofoli573
@sergiogarofoli573 - 15.03.2020 07:29

I'm using Visual Studio instead of Notepad++.
Is fine to me.

Ответить
@kaiserdrache7675
@kaiserdrache7675 - 15.03.2020 02:20

What happened to the volume on this video???
It took you that long to know the file's path??? O_O

Ответить
@siggegaming1704
@siggegaming1704 - 07.03.2020 12:34

my usb capacity tester will be done soon!

Ответить
@SinGames
@SinGames - 15.02.2020 22:28

Does anyone have a batch file that actually batches something together? What I just watched I can do with the right-click menu, or ctrl + c and Ctrl + V. Nothing useful here. but if you shown a way to actually batch files then I would be all over that sub button. I'm looking to batch a single image into multiple images all with different names. I have a list of names but need to see how the code can replicate images with multiple names.

Ответить
@gdavis5193
@gdavis5193 - 10.02.2020 17:14

my grandkids have put .jpeg files in different directories on my e: drive. But they put them anyplace they can drop them. Is there a way to move *.jpeg with some command line that finds them anyplace on the e: drive and puts them all into one folder? I can't search for a name because the grandkids don't remember. Only that they are .jpeg files they drew. Help!

Ответить
@rienvancampenhout9556
@rienvancampenhout9556 - 03.12.2019 20:02

It always say that it cant find the file i want to copy

Ответить
@Felsvideos
@Felsvideos - 28.11.2019 21:31

how do you mark spaces in the path like C:\Desktop\Editing Stuff if i just put it like that it will not take the stuff word into the path

Ответить
@familyguy5081
@familyguy5081 - 25.11.2019 18:17

I appreciate you taking the time to do this. It is actually very helpful... The basics are always helpful

Ответить