• 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.15/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
189 (0.70/day)
Location
PL, Krk (JPN, Tokyo)
System Name Nilin
Processor Ryzen 5 2600 @4Ghz 1.275V
Motherboard Asus Rog Crosshair VIII Hero Wifi
Cooling Noctua NH D15
Memory G. Skill Flare X 2x8gb 3200 Mhz CL14
Video Card(s) Msi GTX 1080 TI FE (Accelero Xtreme IV rev 2)
Storage Samsung Evo 960 250gb M.2 (System), Samsung Evo 860 500gb (Games), WD 1Tb HDD (Garbage)
Display(s) LG 27" UHD IPS, LG24" FHD IPS
Case InWin 303 (+ 7x Fractal Prisma 120mm)
Power Supply Tt Toughpower Grand RGB 850W
Mouse Tt eSPORTS Saphira
Keyboard Logitech Pro Series
Joined
Jan 31, 2010
Messages
3,209 (0.92/day)
System Name Cumquat 2000
Processor AMD RyZen R7 2700 @ 3400MHz
Motherboard Asus TUF X470-Plus Gaming
Cooling Wraith Spire (RGB)
Memory 16GB GSkill TridentZ DR4-3200 16-18-18-38 1.35V
Video Card(s) Asus Strix R9-285 2GB (stand-in for now new one coming)
Storage 1X Samsung 860 EVO 500GB SATA AHCI 1x Sandisk 128GB SSD, 1xWD 2TB red, 1xWD 1TB black, 1xWD 2TB nas
Display(s) ViewSonic VX2457 MHD 75Hz FreeSync 1920x1080p
Case SilverStone Raven RV02B-W + 3x SS AP181 + USB3.0 upgrade
Audio Device(s) Creative SB X-Fi Titanium Fatal1ty Pro PCIe + Pioneer VSX-531 amp Technics 100W Speaker set
Power Supply Enermax RevolutionXT II 750W 80+ Gold
Mouse Logitech G502 Proteus Core
Keyboard Logitech G105
Software Windows 10 X64 PRO (build 1903)
Benchmark Scores it sucks even less much now ;)
I think he wants to replaces files not rename them
 
Joined
Nov 22, 2018
Messages
189 (0.70/day)
Location
PL, Krk (JPN, Tokyo)
System Name Nilin
Processor Ryzen 5 2600 @4Ghz 1.275V
Motherboard Asus Rog Crosshair VIII Hero Wifi
Cooling Noctua NH D15
Memory G. Skill Flare X 2x8gb 3200 Mhz CL14
Video Card(s) Msi GTX 1080 TI FE (Accelero Xtreme IV rev 2)
Storage Samsung Evo 960 250gb M.2 (System), Samsung Evo 860 500gb (Games), WD 1Tb HDD (Garbage)
Display(s) LG 27" UHD IPS, LG24" FHD IPS
Case InWin 303 (+ 7x Fractal Prisma 120mm)
Power Supply Tt Toughpower Grand RGB 850W
Mouse Tt eSPORTS Saphira
Keyboard Logitech Pro Series
oh, i thought he meant extension change... oopsie!
 
Joined
Mar 14, 2009
Messages
4,220 (1.11/day)
Location
Ohio
System Name Fractured puke.
Processor Intel I7-8700k/G4400/AMD 2200g/Ryzen 5 1600
Motherboard MSI z370 Gaming M5/h110/ AMD a320/ AMD B450-ASRock pro 4 atx
Cooling Corsair H110i/Intel/AMD/H60
Memory 16GB G.Skill TridentZ 3200MHZ/8gb 2133mhz/8gb 2400mhz/8gb Viper 3000mhz
Video Card(s) Nvidia GTX 1070ti/integrated/apu/rx570
Storage 960 EVO 500gb/256gb WD Black 2280 M2/Patriot Ignite 480gb SSD/ Inland Pro 256gb SSD/Patriot Scorch-&
Display(s) AOC 32" QHD/Acer 32" QHD/ ViewSonic 24" FHD/ TV
Case Fractal Design Meshify-C/ Rosewill FBM-01/ Rosewill FBM-01/Sigma eclipse
Audio Device(s) creative audigy/nboard/ onboard/inboard
Power Supply Seasonic/TT/TT/Cooler Master white80+ 500w
Mouse Red Dragon/red dragon/Razer/Razer
Keyboard Razer Deatstalker/red dragon RGB/Red Dragon 502/Razer
Software Windows 10Pro x64///

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

bug

Joined
May 22, 2015
Messages
6,337 (4.09/day)
Processor Intel i5-6600k
Motherboard ASRock Z170 Extreme7+
Cooling Arctic Cooling Freezer i11
Memory 2x8GB DDR4 2400 G.Skill
Video Card(s) EVGA GTX 1060 SC
Storage 128 and 256GB OCZ Vertex4, 500GB Samsung 850 EVO, 1TB Crucial MX300 and 3TB Seagate
Display(s) HP ZR24w
Case Chieftec BX01
Power Supply Seasonic 620W M12
Mouse Logitech G502 Proteus Core
Keyboard G.Skill KM780R
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>
 
Joined
Mar 14, 2009
Messages
4,220 (1.11/day)
Location
Ohio
System Name Fractured puke.
Processor Intel I7-8700k/G4400/AMD 2200g/Ryzen 5 1600
Motherboard MSI z370 Gaming M5/h110/ AMD a320/ AMD B450-ASRock pro 4 atx
Cooling Corsair H110i/Intel/AMD/H60
Memory 16GB G.Skill TridentZ 3200MHZ/8gb 2133mhz/8gb 2400mhz/8gb Viper 3000mhz
Video Card(s) Nvidia GTX 1070ti/integrated/apu/rx570
Storage 960 EVO 500gb/256gb WD Black 2280 M2/Patriot Ignite 480gb SSD/ Inland Pro 256gb SSD/Patriot Scorch-&
Display(s) AOC 32" QHD/Acer 32" QHD/ ViewSonic 24" FHD/ TV
Case Fractal Design Meshify-C/ Rosewill FBM-01/ Rosewill FBM-01/Sigma eclipse
Audio Device(s) creative audigy/nboard/ onboard/inboard
Power Supply Seasonic/TT/TT/Cooler Master white80+ 500w
Mouse Red Dragon/red dragon/Razer/Razer
Keyboard Razer Deatstalker/red dragon RGB/Red Dragon 502/Razer
Software Windows 10Pro x64///
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
844 (0.25/day)
Location
Essex, England
System Name Hellfire
Processor Intel I7 4790K OC to 4.6 @ 1.27V
Motherboard Asus Z97 Sabertooth Mk1
Cooling Corsair H100i in Push/Pull with 4x SP120 fans.
Memory Corsair Vengeance 16Gb
Video Card(s) Sapphire Vega64 Nitro+ x2 Crossfire
Storage Samsung 840 Pro SSD (OS), 2TB Caviar Black SATA III Secondary, 2TB Caviar Black SATA III Tertiary,
Display(s) MSI MPG27QC
Case Corsair 750D
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
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
6,337 (4.09/day)
Processor Intel i5-6600k
Motherboard ASRock Z170 Extreme7+
Cooling Arctic Cooling Freezer i11
Memory 2x8GB DDR4 2400 G.Skill
Video Card(s) EVGA GTX 1060 SC
Storage 128 and 256GB OCZ Vertex4, 500GB Samsung 850 EVO, 1TB Crucial MX300 and 3TB Seagate
Display(s) HP ZR24w
Case Chieftec BX01
Power Supply Seasonic 620W M12
Mouse Logitech G502 Proteus Core
Keyboard G.Skill KM780R

bug

Joined
May 22, 2015
Messages
6,337 (4.09/day)
Processor Intel i5-6600k
Motherboard ASRock Z170 Extreme7+
Cooling Arctic Cooling Freezer i11
Memory 2x8GB DDR4 2400 G.Skill
Video Card(s) EVGA GTX 1060 SC
Storage 128 and 256GB OCZ Vertex4, 500GB Samsung 850 EVO, 1TB Crucial MX300 and 3TB Seagate
Display(s) HP ZR24w
Case Chieftec BX01
Power Supply Seasonic 620W M12
Mouse Logitech G502 Proteus Core
Keyboard G.Skill KM780R
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.15/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
6,337 (4.09/day)
Processor Intel i5-6600k
Motherboard ASRock Z170 Extreme7+
Cooling Arctic Cooling Freezer i11
Memory 2x8GB DDR4 2400 G.Skill
Video Card(s) EVGA GTX 1060 SC
Storage 128 and 256GB OCZ Vertex4, 500GB Samsung 850 EVO, 1TB Crucial MX300 and 3TB Seagate
Display(s) HP ZR24w
Case Chieftec BX01
Power Supply Seasonic 620W M12
Mouse Logitech G502 Proteus Core
Keyboard G.Skill KM780R
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
25,119 (6.34/day)
Location
IA, USA
System Name BY-2015
Processor Intel Core i7-6700K (4 x 4.00 GHz) w/ HT and Turbo on
Motherboard MSI Z170A GAMING M7
Cooling Scythe Kotetsu
Memory 2 x Kingston HyperX DDR4-2133 8 GiB
Video Card(s) Sapphire NITRO+ RX 590 Special Edition 8 GiB DVI + HDMI
Storage Crucial MX300 275 GB, Seagate Exos X12 TB 7200 RPM
Display(s) Samsung SyncMaster T240 24" LCD (1920x1200 HDMI) + Samsung SyncMaster 906BW 19" LCD (1440x900 DVI)
Case Coolermaster HAF 932 w/ USB 3.0 5.25" bay
Audio Device(s) Realtek Onboard, Micca OriGen+
Power Supply Enermax Platimax 850w
Mouse SteelSeries Sensei RAW
Keyboard Tesoro Excalibur
Software Windows 10 Pro 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