• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

I need help with a .bat file.

Flpoolboy

New Member
Joined
Jul 16, 2019
Messages
5 (0.00/day)
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.
 
Joined
Nov 22, 2018
Messages
567 (0.29/day)
Location
PL, Krk (JPN, Tokyo)
System Name Nilin
Processor Ryzen 9 5800x
Motherboard Asus Rog Crosshair VIII Hero Wifi
Cooling Lian Li Galahad AIO 360
Memory G. Skill TridentZ Neo 32gb 3600Mhz CL16-16-16-36
Video Card(s) Asus TUF RTX 3080
Storage Samsung Evo 960 250gb (System), Samsung Evo 860 500gb (Misc), Samsung 990 Pro 1Tb (Games)
Display(s) LG 27" UHD IPS, LG Ultragear 27" WQHD Nano IPS
Case InWin 303 (7x Fractal Prisma 120mm)
Power Supply Tt Toughpower Grand RGB 850W
Mouse Razer Viper Ultimate
Keyboard SteelSeries Apex 3
Benchmark Scores https://www.3dmark.com/fs/21022952 (old system)
Joined
Jan 31, 2010
Messages
5,363 (1.04/day)
Location
Gougeland (NZ)
System Name Cumquat 2021
Processor AMD RyZen R7 7800X3D
Motherboard Asus Strix X670E - E Gaming WIFI
Cooling Deep Cool LT720 + CM MasterGel Pro TP + Lian Li Uni Fan V2
Memory 32GB GSkill Trident Z5 Neo 6000
Video Card(s) Sapphire Nitro+ OC RX6800 16GB DDR6 2270Cclk / 2010Mclk
Storage 1x Adata SX8200PRO NVMe 1TB gen3 x4 1X Samsung 980 Pro NVMe Gen 4 x4 1TB, 12TB of HDD Storage
Display(s) AOC 24G2 IPS 144Hz FreeSync Premium 1920x1080p
Case Lian Li O11D XL ROG edition
Audio Device(s) RX6800 via HDMI + Pioneer VSX-531 amp Technics 100W 5.1 Speaker set
Power Supply EVGA 1000W G5 Gold
Mouse Logitech G502 Proteus Core Wired
Keyboard Logitech G915 Wireless
Software Windows 11 X64 PRO (build 23H2)
Benchmark Scores it sucks even more less now ;)
I think he wants to replaces files not rename them
 
Joined
Nov 22, 2018
Messages
567 (0.29/day)
Location
PL, Krk (JPN, Tokyo)
System Name Nilin
Processor Ryzen 9 5800x
Motherboard Asus Rog Crosshair VIII Hero Wifi
Cooling Lian Li Galahad AIO 360
Memory G. Skill TridentZ Neo 32gb 3600Mhz CL16-16-16-36
Video Card(s) Asus TUF RTX 3080
Storage Samsung Evo 960 250gb (System), Samsung Evo 860 500gb (Misc), Samsung 990 Pro 1Tb (Games)
Display(s) LG 27" UHD IPS, LG Ultragear 27" WQHD Nano IPS
Case InWin 303 (7x Fractal Prisma 120mm)
Power Supply Tt Toughpower Grand RGB 850W
Mouse Razer Viper Ultimate
Keyboard SteelSeries Apex 3
Benchmark Scores https://www.3dmark.com/fs/21022952 (old system)
oh, i thought he meant extension change... oopsie!
 

bug

Joined
May 22, 2015
Messages
13,163 (4.07/day)
Processor Intel i5-12600k
Motherboard Asus H670 TUF
Cooling Arctic Freezer 34
Memory 2x16GB DDR4 3600 G.Skill Ripjaws V
Video Card(s) EVGA GTX 1060 SC
Storage 500GB Samsung 970 EVO, 500GB Samsung 850 EVO, 1TB Crucial MX300 and 2TB Crucial MX500
Display(s) Dell U3219Q + HP ZR24w
Case Raijintek Thetis
Audio Device(s) Audioquest Dragonfly Red :D
Power Supply Seasonic 620W M12
Mouse Logitech G502 Proteus Core
Keyboard G.Skill KM780R
Software Arch Linux + Win10
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>
 
D

Deleted member 67555

Guest
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
 
Joined
May 3, 2010
Messages
1,086 (0.21/day)
Location
Essex, England
Processor Ryzen 5900X OC 5150Mhz
Motherboard Asus ROG Crosshair VIII Formula
Cooling Custom EKWB for CPU, VRM's & GPU with 2x 480mm Rads
Memory Gskill TridentZ 3600 Mhz C17
Video Card(s) Powercolor RX 6900XT Liquid Devil Ultimate
Storage Samsung 970 Evo Plus 2TB x 2 Raid0
Display(s) MSI Optix MAG272CQR 27 1440p x2
Case Corsair 1000D
Audio Device(s) onboard 7.1 HD Audio
Power Supply Seasonic PRIME Ultra 1300w PSU
Mouse Logitech G300s
Keyboard Logitech G19s
Software Windows 10 64Bit
Benchmark Scores R20 : 9329 Timespy: 21455
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.
 

bug

Joined
May 22, 2015
Messages
13,163 (4.07/day)
Processor Intel i5-12600k
Motherboard Asus H670 TUF
Cooling Arctic Freezer 34
Memory 2x16GB DDR4 3600 G.Skill Ripjaws V
Video Card(s) EVGA GTX 1060 SC
Storage 500GB Samsung 970 EVO, 500GB Samsung 850 EVO, 1TB Crucial MX300 and 2TB Crucial MX500
Display(s) Dell U3219Q + HP ZR24w
Case Raijintek Thetis
Audio Device(s) Audioquest Dragonfly Red :D
Power Supply Seasonic 620W M12
Mouse Logitech G502 Proteus Core
Keyboard G.Skill KM780R
Software Arch Linux + Win10

bug

Joined
May 22, 2015
Messages
13,163 (4.07/day)
Processor Intel i5-12600k
Motherboard Asus H670 TUF
Cooling Arctic Freezer 34
Memory 2x16GB DDR4 3600 G.Skill Ripjaws V
Video Card(s) EVGA GTX 1060 SC
Storage 500GB Samsung 970 EVO, 500GB Samsung 850 EVO, 1TB Crucial MX300 and 2TB Crucial MX500
Display(s) Dell U3219Q + HP ZR24w
Case Raijintek Thetis
Audio Device(s) Audioquest Dragonfly Red :D
Power Supply Seasonic 620W M12
Mouse Logitech G502 Proteus Core
Keyboard G.Skill KM780R
Software Arch Linux + Win10
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

New Member
Joined
Jul 16, 2019
Messages
5 (0.00/day)
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

Joined
May 22, 2015
Messages
13,163 (4.07/day)
Processor Intel i5-12600k
Motherboard Asus H670 TUF
Cooling Arctic Freezer 34
Memory 2x16GB DDR4 3600 G.Skill Ripjaws V
Video Card(s) EVGA GTX 1060 SC
Storage 500GB Samsung 970 EVO, 500GB Samsung 850 EVO, 1TB Crucial MX300 and 2TB Crucial MX500
Display(s) Dell U3219Q + HP ZR24w
Case Raijintek Thetis
Audio Device(s) Audioquest Dragonfly Red :D
Power Supply Seasonic 620W M12
Mouse Logitech G502 Proteus Core
Keyboard G.Skill KM780R
Software Arch Linux + Win10
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".
 

FordGT90Concept

"I go fast!1!11!1!"
Joined
Oct 13, 2008
Messages
26,259 (4.65/day)
Location
IA, USA
System Name BY-2021
Processor AMD Ryzen 7 5800X (65w eco profile)
Motherboard MSI B550 Gaming Plus
Cooling Scythe Mugen (rev 5)
Memory 2 x Kingston HyperX DDR4-3200 32 GiB
Video Card(s) AMD Radeon RX 7900 XT
Storage Samsung 980 Pro, Seagate Exos X20 TB 7200 RPM
Display(s) Nixeus NX-EDG274K (3840x2160@144 DP) + Samsung SyncMaster 906BW (1440x900@60 HDMI-DVI)
Case Coolermaster HAF 932 w/ USB 3.0 5.25" bay + USB 3.2 (A+C) 3.5" bay
Audio Device(s) Realtek ALC1150, Micca OriGen+
Power Supply Enermax Platimax 850w
Mouse Nixeus REVEL-X
Keyboard Tesoro Excalibur
Software Windows 10 Home 64-bit
Benchmark Scores Faster than the tortoise; slower than the hare.
For future reference, there is xcopy too which has a lot more options.
 
Top