Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Can I get help with making .bat files?
New Posts  All Forums:Forum Nav:

Can I get help with making .bat files?

post #1 of 23
Thread Starter 

Hi, I'm wondering if this is possible.

 

Can I make .bat files to do the following? Most of these are registry changes.

 

  • DISABLE SYSTEM RESTORE

  • DISABLE DRIVE INDEXING

  • DISABLE DRIVE DEFRAG

  • TURN OFF PAGEFILE

  • TURN OFF HIBERNATION

  • DISABLE PREFETCH AND SUPERFETCH

  • DISABLE WINDOWS SEARCH AND SUPERFETCH

  • DISABLE ‘CLEARPAGEFILEATSHUTDOWN’ AND ‘LARGESYSTEMCACHE‘

  • Modify NTFS MEMORY USAGE in regedit to a value of 1 & NTFS DISABLE NAME CREATION to a value of 2

Phoneix
(29 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-3770K @ 4.8Ghz 24/7 ASRock Z77 Extreme4 Gigabyte GTX 670 WindForce OC  G.SKILL 16GB (2 x 8GB) DDR3 1866 10CAS 
Hard DriveHard DriveHard DriveOptical Drive
Western Digital Green WD20EARX 2TB 64MB Cache S... Seagate Backup Plus 3TB USB 3.0 Black Desktop H... OCZ Vertex 4 128GB External Memorex DVD Burner 
CoolingOSMonitorMonitor
Corsair H60 push/pull stock Corsair Fans Windows 7 Ultimate 64 bit PLANAR PX2710MW 27" 2ms ASUS VE248Q Black 24" 2ms LED 
KeyboardPowerCaseMouse
Corsair K70 (Red/Black) Mechanical Keyboard - C... Antec TruePower New TP-750 Blue 750W modular Corsair Vengeance C70 Arctic White SteelSeries Sensei Fnatic Edition + Logitech G700 
Mouse PadAudioAudioAudio
SteelSeries QcK+ DOTA 2 Edition (x2) FiiO E6 FiiO E09k Audio Technica A700 
AudioAudioAudioAudio
Sennheiser HD 280 Sennheiser HD 201 Grado 60i M-Audio Studiophile AV40 Speakers 
OtherOtherOtherOther
Hauppauge WinTV-HVR 1850 TP-Link 300Mbps power outlet ethernet adapter (... Rosewill RNX-N600UBE Wireless Dual Band Adapter  NZXT Hue LED strip controller 
Other
Cosmos 5.25" drawer rack 
  hide details  
Reply
Phoneix
(29 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-3770K @ 4.8Ghz 24/7 ASRock Z77 Extreme4 Gigabyte GTX 670 WindForce OC  G.SKILL 16GB (2 x 8GB) DDR3 1866 10CAS 
Hard DriveHard DriveHard DriveOptical Drive
Western Digital Green WD20EARX 2TB 64MB Cache S... Seagate Backup Plus 3TB USB 3.0 Black Desktop H... OCZ Vertex 4 128GB External Memorex DVD Burner 
CoolingOSMonitorMonitor
Corsair H60 push/pull stock Corsair Fans Windows 7 Ultimate 64 bit PLANAR PX2710MW 27" 2ms ASUS VE248Q Black 24" 2ms LED 
KeyboardPowerCaseMouse
Corsair K70 (Red/Black) Mechanical Keyboard - C... Antec TruePower New TP-750 Blue 750W modular Corsair Vengeance C70 Arctic White SteelSeries Sensei Fnatic Edition + Logitech G700 
Mouse PadAudioAudioAudio
SteelSeries QcK+ DOTA 2 Edition (x2) FiiO E6 FiiO E09k Audio Technica A700 
AudioAudioAudioAudio
Sennheiser HD 280 Sennheiser HD 201 Grado 60i M-Audio Studiophile AV40 Speakers 
OtherOtherOtherOther
Hauppauge WinTV-HVR 1850 TP-Link 300Mbps power outlet ethernet adapter (... Rosewill RNX-N600UBE Wireless Dual Band Adapter  NZXT Hue LED strip controller 
Other
Cosmos 5.25" drawer rack 
  hide details  
Reply
post #2 of 23
Solo III
(18 items)
 
  
CPUMotherboardGraphicsGraphics
Intel Core i5 2500K | 4.4Ghz ASRock | P67 Extreme4 EVGA | GTX 560 Ti  EVGA | GTS 250 | Physx 
RAMHard DriveHard DriveOptical Drive
G.Skill | Sniper | 4*4 Crucial | C300 | 128GB WD | Black | 500GB LG | Bluray 
CoolingOSMonitorMonitor
Xigmatek Gaia | Push/Pull W7 | Professional | 64bit LG | IPS | 23" | E2370V-BF Dell | 15" | Vertical 
MonitorKeyboardPowerCase
Asus | 19"  DasKeyboard | MX Browns Corsair | AX750 COOLER MASTER | RC-692 
MouseMouse Pad
Logitech | M510 steelseries 
  hide details  
Reply
Solo III
(18 items)
 
  
CPUMotherboardGraphicsGraphics
Intel Core i5 2500K | 4.4Ghz ASRock | P67 Extreme4 EVGA | GTX 560 Ti  EVGA | GTS 250 | Physx 
RAMHard DriveHard DriveOptical Drive
G.Skill | Sniper | 4*4 Crucial | C300 | 128GB WD | Black | 500GB LG | Bluray 
CoolingOSMonitorMonitor
Xigmatek Gaia | Push/Pull W7 | Professional | 64bit LG | IPS | 23" | E2370V-BF Dell | 15" | Vertical 
MonitorKeyboardPowerCase
Asus | 19"  DasKeyboard | MX Browns Corsair | AX750 COOLER MASTER | RC-692 
MouseMouse Pad
Logitech | M510 steelseries 
  hide details  
Reply
post #3 of 23
Thread Starter 
Quote:
Originally Posted by exnihilo View Post

This isn't posted as a "Let me Google that for you" knock, but:
http://www.google.com/search?q=create+.bat+file+to+edit+registry&aq=2&oq=create+.bat+file&sugexp=chrome,mod=12&sourceid=chrome&ie=UTF-8
cg

 

That'd help if I had any clue where to start.

Phoneix
(29 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-3770K @ 4.8Ghz 24/7 ASRock Z77 Extreme4 Gigabyte GTX 670 WindForce OC  G.SKILL 16GB (2 x 8GB) DDR3 1866 10CAS 
Hard DriveHard DriveHard DriveOptical Drive
Western Digital Green WD20EARX 2TB 64MB Cache S... Seagate Backup Plus 3TB USB 3.0 Black Desktop H... OCZ Vertex 4 128GB External Memorex DVD Burner 
CoolingOSMonitorMonitor
Corsair H60 push/pull stock Corsair Fans Windows 7 Ultimate 64 bit PLANAR PX2710MW 27" 2ms ASUS VE248Q Black 24" 2ms LED 
KeyboardPowerCaseMouse
Corsair K70 (Red/Black) Mechanical Keyboard - C... Antec TruePower New TP-750 Blue 750W modular Corsair Vengeance C70 Arctic White SteelSeries Sensei Fnatic Edition + Logitech G700 
Mouse PadAudioAudioAudio
SteelSeries QcK+ DOTA 2 Edition (x2) FiiO E6 FiiO E09k Audio Technica A700 
AudioAudioAudioAudio
Sennheiser HD 280 Sennheiser HD 201 Grado 60i M-Audio Studiophile AV40 Speakers 
OtherOtherOtherOther
Hauppauge WinTV-HVR 1850 TP-Link 300Mbps power outlet ethernet adapter (... Rosewill RNX-N600UBE Wireless Dual Band Adapter  NZXT Hue LED strip controller 
Other
Cosmos 5.25" drawer rack 
  hide details  
Reply
Phoneix
(29 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-3770K @ 4.8Ghz 24/7 ASRock Z77 Extreme4 Gigabyte GTX 670 WindForce OC  G.SKILL 16GB (2 x 8GB) DDR3 1866 10CAS 
Hard DriveHard DriveHard DriveOptical Drive
Western Digital Green WD20EARX 2TB 64MB Cache S... Seagate Backup Plus 3TB USB 3.0 Black Desktop H... OCZ Vertex 4 128GB External Memorex DVD Burner 
CoolingOSMonitorMonitor
Corsair H60 push/pull stock Corsair Fans Windows 7 Ultimate 64 bit PLANAR PX2710MW 27" 2ms ASUS VE248Q Black 24" 2ms LED 
KeyboardPowerCaseMouse
Corsair K70 (Red/Black) Mechanical Keyboard - C... Antec TruePower New TP-750 Blue 750W modular Corsair Vengeance C70 Arctic White SteelSeries Sensei Fnatic Edition + Logitech G700 
Mouse PadAudioAudioAudio
SteelSeries QcK+ DOTA 2 Edition (x2) FiiO E6 FiiO E09k Audio Technica A700 
AudioAudioAudioAudio
Sennheiser HD 280 Sennheiser HD 201 Grado 60i M-Audio Studiophile AV40 Speakers 
OtherOtherOtherOther
Hauppauge WinTV-HVR 1850 TP-Link 300Mbps power outlet ethernet adapter (... Rosewill RNX-N600UBE Wireless Dual Band Adapter  NZXT Hue LED strip controller 
Other
Cosmos 5.25" drawer rack 
  hide details  
Reply
post #4 of 23
Quote:
Originally Posted by pLuhhmm View Post

That'd help if I had any clue where to start.
We're not really sure where you're stuck.

Batch files are just plain ASCII documents with a .BAT extension. So just copy and paste whatever lines of code you find online, into notepad, and save.

If you're completely new to this, create a virtual machine to test in (or an old PC that doesn't matter if you break it).
post #5 of 23
Quote:
Originally Posted by Plan9 View Post

We're not really sure where you're stuck.
Batch files are just plain ASCII documents with a .BAT extension. So just copy and paste whatever lines of code you find online, into notepad, and save.
If you're completely new to this, create a virtual machine to test in (or an old PC that doesn't matter if you break it).

+1

Basically, Google: TURN OFF PAGEFILE batch file, etc...

cg
Solo III
(18 items)
 
  
CPUMotherboardGraphicsGraphics
Intel Core i5 2500K | 4.4Ghz ASRock | P67 Extreme4 EVGA | GTX 560 Ti  EVGA | GTS 250 | Physx 
RAMHard DriveHard DriveOptical Drive
G.Skill | Sniper | 4*4 Crucial | C300 | 128GB WD | Black | 500GB LG | Bluray 
CoolingOSMonitorMonitor
Xigmatek Gaia | Push/Pull W7 | Professional | 64bit LG | IPS | 23" | E2370V-BF Dell | 15" | Vertical 
MonitorKeyboardPowerCase
Asus | 19"  DasKeyboard | MX Browns Corsair | AX750 COOLER MASTER | RC-692 
MouseMouse Pad
Logitech | M510 steelseries 
  hide details  
Reply
Solo III
(18 items)
 
  
CPUMotherboardGraphicsGraphics
Intel Core i5 2500K | 4.4Ghz ASRock | P67 Extreme4 EVGA | GTX 560 Ti  EVGA | GTS 250 | Physx 
RAMHard DriveHard DriveOptical Drive
G.Skill | Sniper | 4*4 Crucial | C300 | 128GB WD | Black | 500GB LG | Bluray 
CoolingOSMonitorMonitor
Xigmatek Gaia | Push/Pull W7 | Professional | 64bit LG | IPS | 23" | E2370V-BF Dell | 15" | Vertical 
MonitorKeyboardPowerCase
Asus | 19"  DasKeyboard | MX Browns Corsair | AX750 COOLER MASTER | RC-692 
MouseMouse Pad
Logitech | M510 steelseries 
  hide details  
Reply
post #6 of 23
I'll get you started.. here is a batch file that will disable Hibernation...

Just copy the text below into a .txt file and change the .txt extention to .bat You may need to unhide file extensions for known file types in windows first..


Code:
@ECHO OFF
powercfg -h off
ECHO Hibernation Successfully Disabled!
ECHO.
pause

Just replace the "powercfg -h off" part with the code of your choice to modify it to do other things.
Edited by Jayjr1105 - 10/31/12 at 11:04am
The Family PC
(15 items)
 
HTPC
(9 items)
 
HP ProBook 4430s
(10 items)
 
CPUMotherboardGraphicsRAM
i7 3770K 4.7 GHz @ 1.32v Asus P8Z68-V Gen3 Gigabyte 7870 8gb G.Skill Ripjaws X 1600 
Hard DriveHard DriveOptical DriveCooling
Monster Daytona 240GB Seagate ST3500 Lite-On DVD-RW CM 212+ 
OSMonitorPowerCase
Windows 7 Pro x64 Acer H235Hbmid 23" CORSAIR HX-650 Corsair Carbide 500R (white) 
Mouse
Logitech M705 
CPUMotherboardGraphicsRAM
Athlon II X4 645 MSI el cheapo Gigabyte GT 220  4GB Crucial DDR3 
Hard DriveOptical DriveOSMonitor
WD Blue 160GB Lite-On DVDRW Windows 7 Pro 64 46" Vizio LCD 1080P 
Case
In-Win basic mATX 
CPUGraphicsRAMHard Drive
i5 2450M Intel HD 3000 8GB G.Skill 1600 Samsung 830 128GB 
OSMonitorAudio
Windows 8 Pro x64 14" 1366 x 768 LED SRS Premium 
  hide details  
Reply
The Family PC
(15 items)
 
HTPC
(9 items)
 
HP ProBook 4430s
(10 items)
 
CPUMotherboardGraphicsRAM
i7 3770K 4.7 GHz @ 1.32v Asus P8Z68-V Gen3 Gigabyte 7870 8gb G.Skill Ripjaws X 1600 
Hard DriveHard DriveOptical DriveCooling
Monster Daytona 240GB Seagate ST3500 Lite-On DVD-RW CM 212+ 
OSMonitorPowerCase
Windows 7 Pro x64 Acer H235Hbmid 23" CORSAIR HX-650 Corsair Carbide 500R (white) 
Mouse
Logitech M705 
CPUMotherboardGraphicsRAM
Athlon II X4 645 MSI el cheapo Gigabyte GT 220  4GB Crucial DDR3 
Hard DriveOptical DriveOSMonitor
WD Blue 160GB Lite-On DVDRW Windows 7 Pro 64 46" Vizio LCD 1080P 
Case
In-Win basic mATX 
CPUGraphicsRAMHard Drive
i5 2450M Intel HD 3000 8GB G.Skill 1600 Samsung 830 128GB 
OSMonitorAudio
Windows 8 Pro x64 14" 1366 x 768 LED SRS Premium 
  hide details  
Reply
post #7 of 23
Thread Starter 
Quote:
Originally Posted by Jayjr1105 View Post

I'll get you started.. here is a batch file that will disable Hibernation...
Just copy the text below into a .txt file and change the .txt extention to .bat You may need to unhide file extensions for known file types in windows first..
Code:
@ECHO OFF
powercfg -h off
ECHO Hibernation Successfully Disabled!
ECHO.
pause
Just replace the "powercfg -h off" part with the code of your choice to modify it to do other things.

 

Alright, thanks. I think my problem now is to find the what to replace that with.

Phoneix
(29 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-3770K @ 4.8Ghz 24/7 ASRock Z77 Extreme4 Gigabyte GTX 670 WindForce OC  G.SKILL 16GB (2 x 8GB) DDR3 1866 10CAS 
Hard DriveHard DriveHard DriveOptical Drive
Western Digital Green WD20EARX 2TB 64MB Cache S... Seagate Backup Plus 3TB USB 3.0 Black Desktop H... OCZ Vertex 4 128GB External Memorex DVD Burner 
CoolingOSMonitorMonitor
Corsair H60 push/pull stock Corsair Fans Windows 7 Ultimate 64 bit PLANAR PX2710MW 27" 2ms ASUS VE248Q Black 24" 2ms LED 
KeyboardPowerCaseMouse
Corsair K70 (Red/Black) Mechanical Keyboard - C... Antec TruePower New TP-750 Blue 750W modular Corsair Vengeance C70 Arctic White SteelSeries Sensei Fnatic Edition + Logitech G700 
Mouse PadAudioAudioAudio
SteelSeries QcK+ DOTA 2 Edition (x2) FiiO E6 FiiO E09k Audio Technica A700 
AudioAudioAudioAudio
Sennheiser HD 280 Sennheiser HD 201 Grado 60i M-Audio Studiophile AV40 Speakers 
OtherOtherOtherOther
Hauppauge WinTV-HVR 1850 TP-Link 300Mbps power outlet ethernet adapter (... Rosewill RNX-N600UBE Wireless Dual Band Adapter  NZXT Hue LED strip controller 
Other
Cosmos 5.25" drawer rack 
  hide details  
Reply
Phoneix
(29 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-3770K @ 4.8Ghz 24/7 ASRock Z77 Extreme4 Gigabyte GTX 670 WindForce OC  G.SKILL 16GB (2 x 8GB) DDR3 1866 10CAS 
Hard DriveHard DriveHard DriveOptical Drive
Western Digital Green WD20EARX 2TB 64MB Cache S... Seagate Backup Plus 3TB USB 3.0 Black Desktop H... OCZ Vertex 4 128GB External Memorex DVD Burner 
CoolingOSMonitorMonitor
Corsair H60 push/pull stock Corsair Fans Windows 7 Ultimate 64 bit PLANAR PX2710MW 27" 2ms ASUS VE248Q Black 24" 2ms LED 
KeyboardPowerCaseMouse
Corsair K70 (Red/Black) Mechanical Keyboard - C... Antec TruePower New TP-750 Blue 750W modular Corsair Vengeance C70 Arctic White SteelSeries Sensei Fnatic Edition + Logitech G700 
Mouse PadAudioAudioAudio
SteelSeries QcK+ DOTA 2 Edition (x2) FiiO E6 FiiO E09k Audio Technica A700 
AudioAudioAudioAudio
Sennheiser HD 280 Sennheiser HD 201 Grado 60i M-Audio Studiophile AV40 Speakers 
OtherOtherOtherOther
Hauppauge WinTV-HVR 1850 TP-Link 300Mbps power outlet ethernet adapter (... Rosewill RNX-N600UBE Wireless Dual Band Adapter  NZXT Hue LED strip controller 
Other
Cosmos 5.25" drawer rack 
  hide details  
Reply
post #8 of 23
This might be too advanced for you...or not...hard to tell...but MSFN Unattended is quite possibly the greatest resource on the entire internet for modifying the registry via batch files/the CLI. This page is more in the context of modifying whilst installing windows, but if you explore on there long enough there is a lot of that sort thing and you will learn a lot. At least i did.
 
VM Server
(17 items)
 
 
CPUGraphicsRAMHard Drive
Intel Ivy Bridge Core i7-3630QM nVidia GeForce GTX 680M 16GB DDR3 1600MHz Dual Channel Memory (2 SODIMMS) Hard Drive: Serial-ATA II 3GB/s 
Hard DriveOSMonitorPower
Hard Drive: Serial-ATA II 3GB/s Windows 7 Ultimate x64 17.3" FHD 16:9 (1920x1080) Battery: Smart Li-ion Battery (8-Cell) 
Audio
Sound Blaster Compatible 3D Audio 
CPUMotherboardGraphicsRAM
Intel Core i7 860 Biostar T5 XE Radeon HD 5870 Corsair 16GB  
Hard DriveHard DriveOptical DriveOS
Western Digital hard drive wd1001fals-00e8b0 Maxtor 300GB I don't need no stinking optical drive Microsoft Windows 7 Ultimate x64 
MonitorMonitorKeyboardPower
HP ZR24w 24'' Samsung SyncMaster 24" logitech wireless k360 Seventeam ST-850ZAF 850W ATX 
CaseMouseAudioAudio
Thermaltake V9 Black Edition Logitech G500 Programmable Gaming Mouse FiiO E7 USB DAC and Portable Headphone Amplifier Sennheiser HD555 Professional Headphones 
  hide details  
Reply
 
VM Server
(17 items)
 
 
CPUGraphicsRAMHard Drive
Intel Ivy Bridge Core i7-3630QM nVidia GeForce GTX 680M 16GB DDR3 1600MHz Dual Channel Memory (2 SODIMMS) Hard Drive: Serial-ATA II 3GB/s 
Hard DriveOSMonitorPower
Hard Drive: Serial-ATA II 3GB/s Windows 7 Ultimate x64 17.3" FHD 16:9 (1920x1080) Battery: Smart Li-ion Battery (8-Cell) 
Audio
Sound Blaster Compatible 3D Audio 
CPUMotherboardGraphicsRAM
Intel Core i7 860 Biostar T5 XE Radeon HD 5870 Corsair 16GB  
Hard DriveHard DriveOptical DriveOS
Western Digital hard drive wd1001fals-00e8b0 Maxtor 300GB I don't need no stinking optical drive Microsoft Windows 7 Ultimate x64 
MonitorMonitorKeyboardPower
HP ZR24w 24'' Samsung SyncMaster 24" logitech wireless k360 Seventeam ST-850ZAF 850W ATX 
CaseMouseAudioAudio
Thermaltake V9 Black Edition Logitech G500 Programmable Gaming Mouse FiiO E7 USB DAC and Portable Headphone Amplifier Sennheiser HD555 Professional Headphones 
  hide details  
Reply
post #9 of 23
If they're registry changes why not use .reg files?

And anyways unless you're trying to be old-windows compatible you should use .cmd instead of .bat/
post #10 of 23
Quote:
Originally Posted by 3930K View Post

If they're registry changes why not use .reg files?
And anyways unless you're trying to be old-windows compatible you should use .cmd instead of .bat/

.cmd is old too - it has been supported since at least Windows 2000.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Can I get help with making .bat files?