# I need help with a .bat file.



## Flpoolboy (Jul 16, 2019)

Hi, I was wanting to make a .bat file so that when you open it replaces a certain file with a different file, the files im trying to replace are .png's and .mesh's.


----------



## Lorec (Jul 16, 2019)

https://www.bulkrenameutility.co.uk/Main_Intro.php 

use this instead. 
If You have whole folder of files, it will rename and change extension of them as You see fit.
You can customize a lot too.


----------



## Athlonite (Jul 16, 2019)

I think he wants to replaces files not rename them


----------



## Lorec (Jul 16, 2019)

oh, i thought he meant extension change... oopsie!


----------



## Deleted member 67555 (Jul 16, 2019)

How to create an automated task using Task Scheduler on Windows 10
					

Task Scheduler lets you automate tasks on Windows 10, and in this guide, we'll show you the steps to create and schedule your first task.




					www.windowscentral.com
				




I used something like this on 7 to remove then retrieve TV guide data.


----------



## bug (Jul 16, 2019)

Flpoolboy said:


> Hi, I was wanting to make a .bat file so that when you open it replaces a certain file with a different file, the files im trying to replace are .png's and .mesh's.


I'm not sure I understand the question, but if I do you need:

`copy /y <replacing_file> <file_to_be_replaced>`


----------



## Deleted member 67555 (Jul 16, 2019)

bug said:


> I'm not sure I understand the question, but if I do you need:
> 
> `copy /y <replacing_file> <file_to_be_replaced>`


Yeah.. Run that in an Event for your script


----------



## Hellfire (Jul 16, 2019)

So copy command as already said,

copy /y (copies & suppresses prompts)
or
copy /-y (copies & allows confirmation prompts for overwriting)


Only thing I would say, I don't like copy overwriting with batch files as if there is an issue (a copy is corrupt) then you lose your original. 


What is the copying for or how does it work, I'd possibly suggest a more complex but also safer method where the originals are moved, data is copied (not replacing the originals) and then the originals can be deleted at a later date (ie two days later maybe by the batch file)

But depends, you've not given details on what it's for.


----------



## Flpoolboy (Jul 16, 2019)

Is there a way to just copy a file to a specified path?


----------



## bug (Jul 16, 2019)

Flpoolboy said:


> Is there a way to just copy a file to a specified path?


Yes, there is: https://www.techpowerup.com/forums/threads/i-need-help-with-a-bat-file.257407/post-4081725

Are you aware you can issue
`copy /?`
if you're unsure how copy works?


----------



## Flpoolboy (Jul 16, 2019)

I tried to do copy but I kept getting syntax error.


----------



## bug (Jul 16, 2019)

Flpoolboy said:


> I tried to do copy but I kept getting syntax error.


Ok, tell me where's the file you want to copy and where's the file you want to replace and I'll give you the copy command.


----------



## Flpoolboy (Jul 16, 2019)

Source: C:\Program Files (x86)\Roblox\Versions\version-8ea9490e0ca04991\content\textures

Target : C:\Users\flpoo\OneDrive\Desktop\Roblox Skin Changer\MAIN FILES\faces\Epic Face


----------



## bug (Jul 16, 2019)

`copy /y "C:\Program Files (x86)\Roblox\Versions\version-8ea9490e0ca04991\content\textures\*.*" "C:\Users\flpoo\OneDrive\Desktop\Roblox Skin Changer\MAIN FILES\faces\Epic Face"`

I think "textures" is actually a folder. If it isn't, then instead of "textures\*.*" just write "textures".


----------



## Flpoolboy (Jul 16, 2019)

Thank you so much!


----------



## FordGT90Concept (Jul 16, 2019)

For future reference, there is xcopy too which has a lot more options.


----------

