Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Help with a few small scripts
New Posts  All Forums:Forum Nav:

Help with a few small scripts

post #1 of 11
Thread Starter 
Ok, I have this install and optimization guide here: Sean's Windows 7 Install & Optimization Guide for SSDs & HDDs

I want to have a few small script made for most of the steps.

For example one to:
  • Turn Off the Hibernation File and possibly an option to shrink it to the minimum amount instead
  • Check to see if the TRIM command is being issued and possibly have an option to enable it.
  • Disable Prefetch and Superfetch in the registry (and in the services if possible)
  • and a few others for registry adjustments and such

Is anyone willing to add me on steam or skype or something to help me out?

Thanks
Le Main Rig
(17 items)
 
Terrorbyte V2
(17 items)
 
 
CPUMotherboardGraphicsRAM
i7-6700K Asus Sabertooth Z170 Mark 1 Gigabyte GTX 960 WindForce 2X OC G.SKILL Ripjaws V  
Hard DriveHard DriveHard DriveHard Drive
1050GB Crucial MX300 1050GB Crucial MX300 960GB OCZ RD400 1TB Micron M600 
Hard DriveCoolingOSMonitor
1TB WD Blue Noctua NH-U12S Windows 10 Pro 64-Bit BenQ GW2765HT 
MonitorKeyboardPowerCase
BenQ GW2765HT FUNC KB-460 Corsair RM650 Fractal Design R5 
Mouse
Logitec G500 
CPUCPUMotherboardRAM
Intel Xeon L5520 Intel Xeon L5520 SuperMicro X8DTi-F 48GB Nanya 1066MHz ECC RDIMM 
Hard DriveHard DriveHard DriveHard Drive
128GB Samsung 830 480GB SanDisk Extreme II 2TB WD Red 2TB Samung Spinpoint F4 
Hard DriveHard DriveHard DriveHard Drive
2TB Hitachi Deskstar 7K3000 1TB Samsung Spinpoint F3  3TB Toshiba DT01ACA300 Seagate Barracuda 7200.14 
OSPowerCaseOther
Windows Server 2012 R2 Datacenter  Corsair 650TX  Norco RPC 4224 LSI 9261-8i 
Other
Intel RES2CV240 
  hide details  
Reply
Le Main Rig
(17 items)
 
Terrorbyte V2
(17 items)
 
 
CPUMotherboardGraphicsRAM
i7-6700K Asus Sabertooth Z170 Mark 1 Gigabyte GTX 960 WindForce 2X OC G.SKILL Ripjaws V  
Hard DriveHard DriveHard DriveHard Drive
1050GB Crucial MX300 1050GB Crucial MX300 960GB OCZ RD400 1TB Micron M600 
Hard DriveCoolingOSMonitor
1TB WD Blue Noctua NH-U12S Windows 10 Pro 64-Bit BenQ GW2765HT 
MonitorKeyboardPowerCase
BenQ GW2765HT FUNC KB-460 Corsair RM650 Fractal Design R5 
Mouse
Logitec G500 
CPUCPUMotherboardRAM
Intel Xeon L5520 Intel Xeon L5520 SuperMicro X8DTi-F 48GB Nanya 1066MHz ECC RDIMM 
Hard DriveHard DriveHard DriveHard Drive
128GB Samsung 830 480GB SanDisk Extreme II 2TB WD Red 2TB Samung Spinpoint F4 
Hard DriveHard DriveHard DriveHard Drive
2TB Hitachi Deskstar 7K3000 1TB Samsung Spinpoint F3  3TB Toshiba DT01ACA300 Seagate Barracuda 7200.14 
OSPowerCaseOther
Windows Server 2012 R2 Datacenter  Corsair 650TX  Norco RPC 4224 LSI 9261-8i 
Other
Intel RES2CV240 
  hide details  
Reply
post #2 of 11
You can do this all with batch files.

Here is the command to start and stop and configure running services:
Code:
sc
Probably stands for service control, at least it does in my head.


The code for checking TRIM is really close to setting TRIM support
checking trim:
Code:
fsutil behavior query disabledeletenotify
setting trim to on:
Code:
fsutil behavior set disabledeletenotify 0
For this no prompt is needed, if trim is already on, setting it on again has no effect..... so for this script just set it to on, no prompt necessary

Same goes for turning hibernation off:
Code:
powercfg.exe /hibernate off
If it already off, doesn't matter, run it anyways no change....



Here is a script that does the above two commands, and stops and disables Defragmentation, System Restore, and Superfetch.
Code:
@echo off
fsutil behavior set disabledeletenotify 0
powercfg.exe /hibernate off
sc stop SysMain
sc config SysMain start= disabled
sc stop VSS
sc config VSS start= disabled
sc stop defragsvc
sc config defragsvc start= disabled
SSD Optimizations.zip 0k .zip file
You have to run this as administrator.


If you need any more help let me know.

edit: fixed a small bug in the script.
edit2: removed unnecessary line in script
Edited by rush2049 - 3/15/12 at 7:35pm
 
Tragbar
(14 items)
 
 
CPUMotherboardGraphicsRAM
Ryzen 1800X Asus Crosshair VI Hero Nvidia Geforce Titan X F4-3600C15D-16GTZ 
Hard DriveHard DriveHard DriveHard Drive
Combined: 6.13 TB of space Samsung SSD 960 EVO 500GB Crucial_CT1050MX300SSD1 M4-CT128M4SSD2 
CoolingCoolingCoolingCooling
EK-Supremacy EVO White Edition PrimoChill PrimoFlex Advanced LRT EK-RES X4 250 (R2.0) Reservoir EK-CoolStream XE 360 
CoolingCoolingCoolingOS
EK-Vardar F4-120ER (2200rpm)  EK-Ekoolant EVO Liquid Coolant EK-XTOP Revo D5 PWM Pump Windows 10 Pro 
MonitorKeyboardPowerCase
Asus VG278H Ducky YOTG Keyboard Corsair AX1200 Corsair Obsidian 800D 
MouseAudioAudioAudio
Logitech G700s Schiit Gungnir Multibit Schiit Mjolnir 2 Schiit LISST 
Audio
Audeze LCD 2 - pre fazor 
CPUMotherboardGraphicsRAM
intel i7 4770K ASRock Z87E-ITX Nvidia Geforce GTX Titan X GSkill F3-2400C10D-16GTX R 
Hard DriveOptical DriveCoolingOS
Samsung 840 Pro 512GB Silverstone 12.7mm Slot Load Blu-Ray Burner Noctua NH-L12 Windows 8 Pro 
MonitorCaseAudioAudio
LG PA75U Slim LED Projector Silverstone SG08 Schiit Bifrost Schiit Asgard 2 
AudioOther
AKG Q701 Headphones Pelican 1510 Green Case  
  hide details  
Reply
 
Tragbar
(14 items)
 
 
CPUMotherboardGraphicsRAM
Ryzen 1800X Asus Crosshair VI Hero Nvidia Geforce Titan X F4-3600C15D-16GTZ 
Hard DriveHard DriveHard DriveHard Drive
Combined: 6.13 TB of space Samsung SSD 960 EVO 500GB Crucial_CT1050MX300SSD1 M4-CT128M4SSD2 
CoolingCoolingCoolingCooling
EK-Supremacy EVO White Edition PrimoChill PrimoFlex Advanced LRT EK-RES X4 250 (R2.0) Reservoir EK-CoolStream XE 360 
CoolingCoolingCoolingOS
EK-Vardar F4-120ER (2200rpm)  EK-Ekoolant EVO Liquid Coolant EK-XTOP Revo D5 PWM Pump Windows 10 Pro 
MonitorKeyboardPowerCase
Asus VG278H Ducky YOTG Keyboard Corsair AX1200 Corsair Obsidian 800D 
MouseAudioAudioAudio
Logitech G700s Schiit Gungnir Multibit Schiit Mjolnir 2 Schiit LISST 
Audio
Audeze LCD 2 - pre fazor 
CPUMotherboardGraphicsRAM
intel i7 4770K ASRock Z87E-ITX Nvidia Geforce GTX Titan X GSkill F3-2400C10D-16GTX R 
Hard DriveOptical DriveCoolingOS
Samsung 840 Pro 512GB Silverstone 12.7mm Slot Load Blu-Ray Burner Noctua NH-L12 Windows 8 Pro 
MonitorCaseAudioAudio
LG PA75U Slim LED Projector Silverstone SG08 Schiit Bifrost Schiit Asgard 2 
AudioOther
AKG Q701 Headphones Pelican 1510 Green Case  
  hide details  
Reply
post #3 of 11
Thread Starter 
lol, sorry about the late reply.

Thanks.

Soo here we go...

I want at first just a few separate files as single downloads so the people can choose more easily what to do rather than run it and do something they don't want to do by mistake.

Turn Off/Shrink the Hibernation File:
Code:
@echo off
powercfg.exe /hibernate off

And how would I be able to set the size to 50? Because in CMD you just type powercfg -h -size 50 and press enter to shrink it, how would I do this with a batch file?

Also, is there a way to combine the options in 1 file? Like when you open up the file you select option 1 -> disable or option 2 -> shrink to 50%?

_______________________________________________________________________________________________________________

Is there a way to turn Off/Shrink Page file in CMD?
_______________________________________________________________________________________________________________

Disable Prefetch and Superfetch:

Ok, so I just do this to disable Superfetch in sevices
Code:
@echo off
sc stop SysMain
sc config SysMain start= disabled

What about in the registry? Does it even need to be touched? Because it is always set to 3, which is enabled. Same goes for Prefetch.
Code:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters

There in the registry "EnablePrefetcher" and "EnableSuperfetch" show as 3 even when Superfetch is disabled in services.
_______________________________________________________________________________________________________________

This is for System protection like step 2 in my guide correct?
Code:
@echo off
sc stop VSS
sc config VSS start= disabled

Could there also be an option to not turn it off but to change the size it is allowed to use?
_______________________________________________________________________________________________________________

And a file to do this:

Speed up Shut down time:
Open the Start Menu, in the search line, type regedit and press Enter
In regedit, go to:
Code:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
In the right pane, right click on WaitToKillServiceTimeout and click on Modify
Type in 1000

Speed up the Menu Show Delay Time:
Press [Win] + R or take the RUN option from the start menu.
Now type regedit there and press Enter Key to open up the Registry Editor Window.
In regedit go to:
Code:
HKEY_CURRENT_USER\Control Panel\Desktop

In the right pane, right click on MenuShowDelay and click on Modify
Type in 1

Change the Mouse Hover Time before Pop-up Displays:
Press [Win] + R or take the RUN option from the start menu.
Now type regedit there and press Enter Key to open up the Registry Editor Window.
In regedit go to:
Code:
HKEY_CURRENT_USER\Control Panel\Mouse

In the right pane, right click on MouseHoverTime and click on Modify
Type in 3
Le Main Rig
(17 items)
 
Terrorbyte V2
(17 items)
 
 
CPUMotherboardGraphicsRAM
i7-6700K Asus Sabertooth Z170 Mark 1 Gigabyte GTX 960 WindForce 2X OC G.SKILL Ripjaws V  
Hard DriveHard DriveHard DriveHard Drive
1050GB Crucial MX300 1050GB Crucial MX300 960GB OCZ RD400 1TB Micron M600 
Hard DriveCoolingOSMonitor
1TB WD Blue Noctua NH-U12S Windows 10 Pro 64-Bit BenQ GW2765HT 
MonitorKeyboardPowerCase
BenQ GW2765HT FUNC KB-460 Corsair RM650 Fractal Design R5 
Mouse
Logitec G500 
CPUCPUMotherboardRAM
Intel Xeon L5520 Intel Xeon L5520 SuperMicro X8DTi-F 48GB Nanya 1066MHz ECC RDIMM 
Hard DriveHard DriveHard DriveHard Drive
128GB Samsung 830 480GB SanDisk Extreme II 2TB WD Red 2TB Samung Spinpoint F4 
Hard DriveHard DriveHard DriveHard Drive
2TB Hitachi Deskstar 7K3000 1TB Samsung Spinpoint F3  3TB Toshiba DT01ACA300 Seagate Barracuda 7200.14 
OSPowerCaseOther
Windows Server 2012 R2 Datacenter  Corsair 650TX  Norco RPC 4224 LSI 9261-8i 
Other
Intel RES2CV240 
  hide details  
Reply
Le Main Rig
(17 items)
 
Terrorbyte V2
(17 items)
 
 
CPUMotherboardGraphicsRAM
i7-6700K Asus Sabertooth Z170 Mark 1 Gigabyte GTX 960 WindForce 2X OC G.SKILL Ripjaws V  
Hard DriveHard DriveHard DriveHard Drive
1050GB Crucial MX300 1050GB Crucial MX300 960GB OCZ RD400 1TB Micron M600 
Hard DriveCoolingOSMonitor
1TB WD Blue Noctua NH-U12S Windows 10 Pro 64-Bit BenQ GW2765HT 
MonitorKeyboardPowerCase
BenQ GW2765HT FUNC KB-460 Corsair RM650 Fractal Design R5 
Mouse
Logitec G500 
CPUCPUMotherboardRAM
Intel Xeon L5520 Intel Xeon L5520 SuperMicro X8DTi-F 48GB Nanya 1066MHz ECC RDIMM 
Hard DriveHard DriveHard DriveHard Drive
128GB Samsung 830 480GB SanDisk Extreme II 2TB WD Red 2TB Samung Spinpoint F4 
Hard DriveHard DriveHard DriveHard Drive
2TB Hitachi Deskstar 7K3000 1TB Samsung Spinpoint F3  3TB Toshiba DT01ACA300 Seagate Barracuda 7200.14 
OSPowerCaseOther
Windows Server 2012 R2 Datacenter  Corsair 650TX  Norco RPC 4224 LSI 9261-8i 
Other
Intel RES2CV240 
  hide details  
Reply
post #4 of 11
Working on those scripts, but you do know the pagefile should be left on the SSD right? http://blogs.msdn.com/b/e7/archive/2009/05/05/support-and-q-a-for-solid-state-drives-and.aspx
 
Tragbar
(14 items)
 
 
CPUMotherboardGraphicsRAM
Ryzen 1800X Asus Crosshair VI Hero Nvidia Geforce Titan X F4-3600C15D-16GTZ 
Hard DriveHard DriveHard DriveHard Drive
Combined: 6.13 TB of space Samsung SSD 960 EVO 500GB Crucial_CT1050MX300SSD1 M4-CT128M4SSD2 
CoolingCoolingCoolingCooling
EK-Supremacy EVO White Edition PrimoChill PrimoFlex Advanced LRT EK-RES X4 250 (R2.0) Reservoir EK-CoolStream XE 360 
CoolingCoolingCoolingOS
EK-Vardar F4-120ER (2200rpm)  EK-Ekoolant EVO Liquid Coolant EK-XTOP Revo D5 PWM Pump Windows 10 Pro 
MonitorKeyboardPowerCase
Asus VG278H Ducky YOTG Keyboard Corsair AX1200 Corsair Obsidian 800D 
MouseAudioAudioAudio
Logitech G700s Schiit Gungnir Multibit Schiit Mjolnir 2 Schiit LISST 
Audio
Audeze LCD 2 - pre fazor 
CPUMotherboardGraphicsRAM
intel i7 4770K ASRock Z87E-ITX Nvidia Geforce GTX Titan X GSkill F3-2400C10D-16GTX R 
Hard DriveOptical DriveCoolingOS
Samsung 840 Pro 512GB Silverstone 12.7mm Slot Load Blu-Ray Burner Noctua NH-L12 Windows 8 Pro 
MonitorCaseAudioAudio
LG PA75U Slim LED Projector Silverstone SG08 Schiit Bifrost Schiit Asgard 2 
AudioOther
AKG Q701 Headphones Pelican 1510 Green Case  
  hide details  
Reply
 
Tragbar
(14 items)
 
 
CPUMotherboardGraphicsRAM
Ryzen 1800X Asus Crosshair VI Hero Nvidia Geforce Titan X F4-3600C15D-16GTZ 
Hard DriveHard DriveHard DriveHard Drive
Combined: 6.13 TB of space Samsung SSD 960 EVO 500GB Crucial_CT1050MX300SSD1 M4-CT128M4SSD2 
CoolingCoolingCoolingCooling
EK-Supremacy EVO White Edition PrimoChill PrimoFlex Advanced LRT EK-RES X4 250 (R2.0) Reservoir EK-CoolStream XE 360 
CoolingCoolingCoolingOS
EK-Vardar F4-120ER (2200rpm)  EK-Ekoolant EVO Liquid Coolant EK-XTOP Revo D5 PWM Pump Windows 10 Pro 
MonitorKeyboardPowerCase
Asus VG278H Ducky YOTG Keyboard Corsair AX1200 Corsair Obsidian 800D 
MouseAudioAudioAudio
Logitech G700s Schiit Gungnir Multibit Schiit Mjolnir 2 Schiit LISST 
Audio
Audeze LCD 2 - pre fazor 
CPUMotherboardGraphicsRAM
intel i7 4770K ASRock Z87E-ITX Nvidia Geforce GTX Titan X GSkill F3-2400C10D-16GTX R 
Hard DriveOptical DriveCoolingOS
Samsung 840 Pro 512GB Silverstone 12.7mm Slot Load Blu-Ray Burner Noctua NH-L12 Windows 8 Pro 
MonitorCaseAudioAudio
LG PA75U Slim LED Projector Silverstone SG08 Schiit Bifrost Schiit Asgard 2 
AudioOther
AKG Q701 Headphones Pelican 1510 Green Case  
  hide details  
Reply
post #5 of 11
Thread Starter 
Quote:
Originally Posted by rush2049 View Post

Working on those scripts, but you do know the pagefile should be left on the SSD right? http://blogs.msdn.com/b/e7/archive/2009/05/05/support-and-q-a-for-solid-state-drives-and.aspx

Thanks, and yes I know that lol. thumb.gif
Le Main Rig
(17 items)
 
Terrorbyte V2
(17 items)
 
 
CPUMotherboardGraphicsRAM
i7-6700K Asus Sabertooth Z170 Mark 1 Gigabyte GTX 960 WindForce 2X OC G.SKILL Ripjaws V  
Hard DriveHard DriveHard DriveHard Drive
1050GB Crucial MX300 1050GB Crucial MX300 960GB OCZ RD400 1TB Micron M600 
Hard DriveCoolingOSMonitor
1TB WD Blue Noctua NH-U12S Windows 10 Pro 64-Bit BenQ GW2765HT 
MonitorKeyboardPowerCase
BenQ GW2765HT FUNC KB-460 Corsair RM650 Fractal Design R5 
Mouse
Logitec G500 
CPUCPUMotherboardRAM
Intel Xeon L5520 Intel Xeon L5520 SuperMicro X8DTi-F 48GB Nanya 1066MHz ECC RDIMM 
Hard DriveHard DriveHard DriveHard Drive
128GB Samsung 830 480GB SanDisk Extreme II 2TB WD Red 2TB Samung Spinpoint F4 
Hard DriveHard DriveHard DriveHard Drive
2TB Hitachi Deskstar 7K3000 1TB Samsung Spinpoint F3  3TB Toshiba DT01ACA300 Seagate Barracuda 7200.14 
OSPowerCaseOther
Windows Server 2012 R2 Datacenter  Corsair 650TX  Norco RPC 4224 LSI 9261-8i 
Other
Intel RES2CV240 
  hide details  
Reply
Le Main Rig
(17 items)
 
Terrorbyte V2
(17 items)
 
 
CPUMotherboardGraphicsRAM
i7-6700K Asus Sabertooth Z170 Mark 1 Gigabyte GTX 960 WindForce 2X OC G.SKILL Ripjaws V  
Hard DriveHard DriveHard DriveHard Drive
1050GB Crucial MX300 1050GB Crucial MX300 960GB OCZ RD400 1TB Micron M600 
Hard DriveCoolingOSMonitor
1TB WD Blue Noctua NH-U12S Windows 10 Pro 64-Bit BenQ GW2765HT 
MonitorKeyboardPowerCase
BenQ GW2765HT FUNC KB-460 Corsair RM650 Fractal Design R5 
Mouse
Logitec G500 
CPUCPUMotherboardRAM
Intel Xeon L5520 Intel Xeon L5520 SuperMicro X8DTi-F 48GB Nanya 1066MHz ECC RDIMM 
Hard DriveHard DriveHard DriveHard Drive
128GB Samsung 830 480GB SanDisk Extreme II 2TB WD Red 2TB Samung Spinpoint F4 
Hard DriveHard DriveHard DriveHard Drive
2TB Hitachi Deskstar 7K3000 1TB Samsung Spinpoint F3  3TB Toshiba DT01ACA300 Seagate Barracuda 7200.14 
OSPowerCaseOther
Windows Server 2012 R2 Datacenter  Corsair 650TX  Norco RPC 4224 LSI 9261-8i 
Other
Intel RES2CV240 
  hide details  
Reply
post #6 of 11
Here is your setup PageFile Script:
Code:
@echo off
echo Current PageFile Statistics:
wmic pagefile list /format:list 

SET /P _max=Max size of PageFile Desired MB:

IF %_max%==0 wmic.exe computersystem where name=”%computername%” set AutomaticManagedPagefile=False

IF NOT %_max%==0 SET /P _min=Min size of PageFile Desired MB:
IF NOT %_max%==0 wmic.exe pagefileset where name=”C:\\pagefile.sys” set InitialSize=%_min%,MaximumSize=%_max%

echo Resulting PageFile Statistics:
wmic pagefile list /format:list 
PAUSE
Setup PageFile.zip 0k .zip file

Still working on the others...

edit:
Here is the hibernationFile script:
Code:
@echo off
echo Current Computer Sleep Statistics: && echo. && echo. 
powercfg -a
echo && echo. && echo. 

SET /P _per=Percentage of Ram to size hibernation file by: 

IF %_per%==0 powercfg.exe /hibernate off

IF NOT %_per%==0 powercfg.exe /hibernate /size %_per%

echo Resulting Computer Sleep Statistics: && echo. && echo. 
powercfg -a
echo && echo. && echo. 
PAUSE
Setup HibernationFile.zip 0k .zip file
Edited by rush2049 - 3/17/12 at 10:28pm
 
Tragbar
(14 items)
 
 
CPUMotherboardGraphicsRAM
Ryzen 1800X Asus Crosshair VI Hero Nvidia Geforce Titan X F4-3600C15D-16GTZ 
Hard DriveHard DriveHard DriveHard Drive
Combined: 6.13 TB of space Samsung SSD 960 EVO 500GB Crucial_CT1050MX300SSD1 M4-CT128M4SSD2 
CoolingCoolingCoolingCooling
EK-Supremacy EVO White Edition PrimoChill PrimoFlex Advanced LRT EK-RES X4 250 (R2.0) Reservoir EK-CoolStream XE 360 
CoolingCoolingCoolingOS
EK-Vardar F4-120ER (2200rpm)  EK-Ekoolant EVO Liquid Coolant EK-XTOP Revo D5 PWM Pump Windows 10 Pro 
MonitorKeyboardPowerCase
Asus VG278H Ducky YOTG Keyboard Corsair AX1200 Corsair Obsidian 800D 
MouseAudioAudioAudio
Logitech G700s Schiit Gungnir Multibit Schiit Mjolnir 2 Schiit LISST 
Audio
Audeze LCD 2 - pre fazor 
CPUMotherboardGraphicsRAM
intel i7 4770K ASRock Z87E-ITX Nvidia Geforce GTX Titan X GSkill F3-2400C10D-16GTX R 
Hard DriveOptical DriveCoolingOS
Samsung 840 Pro 512GB Silverstone 12.7mm Slot Load Blu-Ray Burner Noctua NH-L12 Windows 8 Pro 
MonitorCaseAudioAudio
LG PA75U Slim LED Projector Silverstone SG08 Schiit Bifrost Schiit Asgard 2 
AudioOther
AKG Q701 Headphones Pelican 1510 Green Case  
  hide details  
Reply
 
Tragbar
(14 items)
 
 
CPUMotherboardGraphicsRAM
Ryzen 1800X Asus Crosshair VI Hero Nvidia Geforce Titan X F4-3600C15D-16GTZ 
Hard DriveHard DriveHard DriveHard Drive
Combined: 6.13 TB of space Samsung SSD 960 EVO 500GB Crucial_CT1050MX300SSD1 M4-CT128M4SSD2 
CoolingCoolingCoolingCooling
EK-Supremacy EVO White Edition PrimoChill PrimoFlex Advanced LRT EK-RES X4 250 (R2.0) Reservoir EK-CoolStream XE 360 
CoolingCoolingCoolingOS
EK-Vardar F4-120ER (2200rpm)  EK-Ekoolant EVO Liquid Coolant EK-XTOP Revo D5 PWM Pump Windows 10 Pro 
MonitorKeyboardPowerCase
Asus VG278H Ducky YOTG Keyboard Corsair AX1200 Corsair Obsidian 800D 
MouseAudioAudioAudio
Logitech G700s Schiit Gungnir Multibit Schiit Mjolnir 2 Schiit LISST 
Audio
Audeze LCD 2 - pre fazor 
CPUMotherboardGraphicsRAM
intel i7 4770K ASRock Z87E-ITX Nvidia Geforce GTX Titan X GSkill F3-2400C10D-16GTX R 
Hard DriveOptical DriveCoolingOS
Samsung 840 Pro 512GB Silverstone 12.7mm Slot Load Blu-Ray Burner Noctua NH-L12 Windows 8 Pro 
MonitorCaseAudioAudio
LG PA75U Slim LED Projector Silverstone SG08 Schiit Bifrost Schiit Asgard 2 
AudioOther
AKG Q701 Headphones Pelican 1510 Green Case  
  hide details  
Reply
post #7 of 11
Thread Starter 
The hibernation works fine. Can you add a second option than simply setting the size and make it have the ability to disable as well. I know it lets you disable it when you set it to zero, but an obvious option for it would be nicer. biggrin.gif

And the page file set up doesn't work frown.gif
I have restarted as well.
Le Main Rig
(17 items)
 
Terrorbyte V2
(17 items)
 
 
CPUMotherboardGraphicsRAM
i7-6700K Asus Sabertooth Z170 Mark 1 Gigabyte GTX 960 WindForce 2X OC G.SKILL Ripjaws V  
Hard DriveHard DriveHard DriveHard Drive
1050GB Crucial MX300 1050GB Crucial MX300 960GB OCZ RD400 1TB Micron M600 
Hard DriveCoolingOSMonitor
1TB WD Blue Noctua NH-U12S Windows 10 Pro 64-Bit BenQ GW2765HT 
MonitorKeyboardPowerCase
BenQ GW2765HT FUNC KB-460 Corsair RM650 Fractal Design R5 
Mouse
Logitec G500 
CPUCPUMotherboardRAM
Intel Xeon L5520 Intel Xeon L5520 SuperMicro X8DTi-F 48GB Nanya 1066MHz ECC RDIMM 
Hard DriveHard DriveHard DriveHard Drive
128GB Samsung 830 480GB SanDisk Extreme II 2TB WD Red 2TB Samung Spinpoint F4 
Hard DriveHard DriveHard DriveHard Drive
2TB Hitachi Deskstar 7K3000 1TB Samsung Spinpoint F3  3TB Toshiba DT01ACA300 Seagate Barracuda 7200.14 
OSPowerCaseOther
Windows Server 2012 R2 Datacenter  Corsair 650TX  Norco RPC 4224 LSI 9261-8i 
Other
Intel RES2CV240 
  hide details  
Reply
Le Main Rig
(17 items)
 
Terrorbyte V2
(17 items)
 
 
CPUMotherboardGraphicsRAM
i7-6700K Asus Sabertooth Z170 Mark 1 Gigabyte GTX 960 WindForce 2X OC G.SKILL Ripjaws V  
Hard DriveHard DriveHard DriveHard Drive
1050GB Crucial MX300 1050GB Crucial MX300 960GB OCZ RD400 1TB Micron M600 
Hard DriveCoolingOSMonitor
1TB WD Blue Noctua NH-U12S Windows 10 Pro 64-Bit BenQ GW2765HT 
MonitorKeyboardPowerCase
BenQ GW2765HT FUNC KB-460 Corsair RM650 Fractal Design R5 
Mouse
Logitec G500 
CPUCPUMotherboardRAM
Intel Xeon L5520 Intel Xeon L5520 SuperMicro X8DTi-F 48GB Nanya 1066MHz ECC RDIMM 
Hard DriveHard DriveHard DriveHard Drive
128GB Samsung 830 480GB SanDisk Extreme II 2TB WD Red 2TB Samung Spinpoint F4 
Hard DriveHard DriveHard DriveHard Drive
2TB Hitachi Deskstar 7K3000 1TB Samsung Spinpoint F3  3TB Toshiba DT01ACA300 Seagate Barracuda 7200.14 
OSPowerCaseOther
Windows Server 2012 R2 Datacenter  Corsair 650TX  Norco RPC 4224 LSI 9261-8i 
Other
Intel RES2CV240 
  hide details  
Reply
post #8 of 11
Forgot to test the pagefile one.... as I didn't want to screw with my current system... oh well here I go fiddling.

How about I change the prompt to add (set to 0 for disable),
Having a list with options means bounds checking and i don't wanna make it any more complicated than it has to be.....
 
Tragbar
(14 items)
 
 
CPUMotherboardGraphicsRAM
Ryzen 1800X Asus Crosshair VI Hero Nvidia Geforce Titan X F4-3600C15D-16GTZ 
Hard DriveHard DriveHard DriveHard Drive
Combined: 6.13 TB of space Samsung SSD 960 EVO 500GB Crucial_CT1050MX300SSD1 M4-CT128M4SSD2 
CoolingCoolingCoolingCooling
EK-Supremacy EVO White Edition PrimoChill PrimoFlex Advanced LRT EK-RES X4 250 (R2.0) Reservoir EK-CoolStream XE 360 
CoolingCoolingCoolingOS
EK-Vardar F4-120ER (2200rpm)  EK-Ekoolant EVO Liquid Coolant EK-XTOP Revo D5 PWM Pump Windows 10 Pro 
MonitorKeyboardPowerCase
Asus VG278H Ducky YOTG Keyboard Corsair AX1200 Corsair Obsidian 800D 
MouseAudioAudioAudio
Logitech G700s Schiit Gungnir Multibit Schiit Mjolnir 2 Schiit LISST 
Audio
Audeze LCD 2 - pre fazor 
CPUMotherboardGraphicsRAM
intel i7 4770K ASRock Z87E-ITX Nvidia Geforce GTX Titan X GSkill F3-2400C10D-16GTX R 
Hard DriveOptical DriveCoolingOS
Samsung 840 Pro 512GB Silverstone 12.7mm Slot Load Blu-Ray Burner Noctua NH-L12 Windows 8 Pro 
MonitorCaseAudioAudio
LG PA75U Slim LED Projector Silverstone SG08 Schiit Bifrost Schiit Asgard 2 
AudioOther
AKG Q701 Headphones Pelican 1510 Green Case  
  hide details  
Reply
 
Tragbar
(14 items)
 
 
CPUMotherboardGraphicsRAM
Ryzen 1800X Asus Crosshair VI Hero Nvidia Geforce Titan X F4-3600C15D-16GTZ 
Hard DriveHard DriveHard DriveHard Drive
Combined: 6.13 TB of space Samsung SSD 960 EVO 500GB Crucial_CT1050MX300SSD1 M4-CT128M4SSD2 
CoolingCoolingCoolingCooling
EK-Supremacy EVO White Edition PrimoChill PrimoFlex Advanced LRT EK-RES X4 250 (R2.0) Reservoir EK-CoolStream XE 360 
CoolingCoolingCoolingOS
EK-Vardar F4-120ER (2200rpm)  EK-Ekoolant EVO Liquid Coolant EK-XTOP Revo D5 PWM Pump Windows 10 Pro 
MonitorKeyboardPowerCase
Asus VG278H Ducky YOTG Keyboard Corsair AX1200 Corsair Obsidian 800D 
MouseAudioAudioAudio
Logitech G700s Schiit Gungnir Multibit Schiit Mjolnir 2 Schiit LISST 
Audio
Audeze LCD 2 - pre fazor 
CPUMotherboardGraphicsRAM
intel i7 4770K ASRock Z87E-ITX Nvidia Geforce GTX Titan X GSkill F3-2400C10D-16GTX R 
Hard DriveOptical DriveCoolingOS
Samsung 840 Pro 512GB Silverstone 12.7mm Slot Load Blu-Ray Burner Noctua NH-L12 Windows 8 Pro 
MonitorCaseAudioAudio
LG PA75U Slim LED Projector Silverstone SG08 Schiit Bifrost Schiit Asgard 2 
AudioOther
AKG Q701 Headphones Pelican 1510 Green Case  
  hide details  
Reply
post #9 of 11
Thread Starter 
Quote:
Originally Posted by rush2049 View Post

Forgot to test the pagefile one.... as I didn't want to screw with my current system... oh well here I go fiddling.

How about I change the prompt to add (set to 0 for disable),
Having a list with options means bounds checking and i don't wanna make it any more complicated than it has to be.....

Sounds good to me smile.gif
Le Main Rig
(17 items)
 
Terrorbyte V2
(17 items)
 
 
CPUMotherboardGraphicsRAM
i7-6700K Asus Sabertooth Z170 Mark 1 Gigabyte GTX 960 WindForce 2X OC G.SKILL Ripjaws V  
Hard DriveHard DriveHard DriveHard Drive
1050GB Crucial MX300 1050GB Crucial MX300 960GB OCZ RD400 1TB Micron M600 
Hard DriveCoolingOSMonitor
1TB WD Blue Noctua NH-U12S Windows 10 Pro 64-Bit BenQ GW2765HT 
MonitorKeyboardPowerCase
BenQ GW2765HT FUNC KB-460 Corsair RM650 Fractal Design R5 
Mouse
Logitec G500 
CPUCPUMotherboardRAM
Intel Xeon L5520 Intel Xeon L5520 SuperMicro X8DTi-F 48GB Nanya 1066MHz ECC RDIMM 
Hard DriveHard DriveHard DriveHard Drive
128GB Samsung 830 480GB SanDisk Extreme II 2TB WD Red 2TB Samung Spinpoint F4 
Hard DriveHard DriveHard DriveHard Drive
2TB Hitachi Deskstar 7K3000 1TB Samsung Spinpoint F3  3TB Toshiba DT01ACA300 Seagate Barracuda 7200.14 
OSPowerCaseOther
Windows Server 2012 R2 Datacenter  Corsair 650TX  Norco RPC 4224 LSI 9261-8i 
Other
Intel RES2CV240 
  hide details  
Reply
Le Main Rig
(17 items)
 
Terrorbyte V2
(17 items)
 
 
CPUMotherboardGraphicsRAM
i7-6700K Asus Sabertooth Z170 Mark 1 Gigabyte GTX 960 WindForce 2X OC G.SKILL Ripjaws V  
Hard DriveHard DriveHard DriveHard Drive
1050GB Crucial MX300 1050GB Crucial MX300 960GB OCZ RD400 1TB Micron M600 
Hard DriveCoolingOSMonitor
1TB WD Blue Noctua NH-U12S Windows 10 Pro 64-Bit BenQ GW2765HT 
MonitorKeyboardPowerCase
BenQ GW2765HT FUNC KB-460 Corsair RM650 Fractal Design R5 
Mouse
Logitec G500 
CPUCPUMotherboardRAM
Intel Xeon L5520 Intel Xeon L5520 SuperMicro X8DTi-F 48GB Nanya 1066MHz ECC RDIMM 
Hard DriveHard DriveHard DriveHard Drive
128GB Samsung 830 480GB SanDisk Extreme II 2TB WD Red 2TB Samung Spinpoint F4 
Hard DriveHard DriveHard DriveHard Drive
2TB Hitachi Deskstar 7K3000 1TB Samsung Spinpoint F3  3TB Toshiba DT01ACA300 Seagate Barracuda 7200.14 
OSPowerCaseOther
Windows Server 2012 R2 Datacenter  Corsair 650TX  Norco RPC 4224 LSI 9261-8i 
Other
Intel RES2CV240 
  hide details  
Reply
post #10 of 11
Updated both, pagefile one works now. By the way, these will only work on Windows 7....... (maybe windows vista), but definitely not XP.....

Pagefile:
Code:
@echo off
echo Current PageFile Statistics:
wmic pagefile list /format:list 

SET /P _max=Max size of PageFile Desired MB (-1 for disable, 0 for auto):

wmic computersystem set automaticmanagedpagefile=False

IF %_max%==-1 wmic.exe pagefileset where name="C:\\pagefile.sys" delete

IF NOT %_max%==-1 IF NOT %_max%==0 SET /P _min=Min size of PageFile Desired MB:
IF NOT %_max%==-1 IF NOT %_max%==0 wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=%_min%,MaximumSize=%_max%
IF NOT %_max%==-1 IF %_max%==0 wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=%_max%,MaximumSize=%_max%

echo Resulting PageFile Statistics:
wmic pagefile list /format:list 
PAUSE
Setup PageFile.zip 0k .zip file

HibernationFile:
Code:
@echo off
echo Current Computer Sleep Statistics: && echo. && echo. 
powercfg -a
echo && echo. && echo. 

SET /P _per=Percentage of Ram to size hibernation file by (0 for disable): 

IF %_per%==0 powercfg.exe /hibernate off

IF NOT %_per%==0 powercfg.exe /hibernate /size %_per%

echo Resulting Computer Sleep Statistics: && echo. && echo. 
powercfg -a
echo && echo. && echo. 
PAUSE
Setup HibernationFile.zip 0k .zip file

Working on System Restore now, it is rather more difficult to change than the others via command line.....

Also regarding your question about the registry entries..... The registry is just a store house for settings, just because the settings are still there doesn't mean they are being used at all. Even if the key is named like: "StartThisOnBootUp" doesn't mean whatever looks at that key is running...... disabling the services is adequate. Too much messing with the registry and you might not be able to undo it as not many programs can re-set themselves up from an unknown state.....

edit:

System Restore:
Code:
@echo off
echo Current Computer System Restore:
vssadmin list shadowstorage

SET /P _size=Gigabytes to dedicate to System Restore (0 to disable, affects C:\ drive only): 

IF %_size%==0 sc stop VSS
IF %_size%==0 sc config VSS start= disabled

IF NOT %_size%==0 sc config VSS start= auto
IF NOT %_size%==0 sc start VSS
IF NOT %_size%==0 vssadmin Resize ShadowStorage /On=C: /For=C: /MaxSize=%_size%GB

echo Resulting Computer System Restore:
vssadmin list shadowstorage
echo An error was expected if System Restore was disabled.
PAUSE
Setup System Restore.zip 0k .zip file

Edit: Caught a medium sized bug with the pagefile one, fixed it.....
Edited by rush2049 - 3/17/12 at 11:42pm
 
Tragbar
(14 items)
 
 
CPUMotherboardGraphicsRAM
Ryzen 1800X Asus Crosshair VI Hero Nvidia Geforce Titan X F4-3600C15D-16GTZ 
Hard DriveHard DriveHard DriveHard Drive
Combined: 6.13 TB of space Samsung SSD 960 EVO 500GB Crucial_CT1050MX300SSD1 M4-CT128M4SSD2 
CoolingCoolingCoolingCooling
EK-Supremacy EVO White Edition PrimoChill PrimoFlex Advanced LRT EK-RES X4 250 (R2.0) Reservoir EK-CoolStream XE 360 
CoolingCoolingCoolingOS
EK-Vardar F4-120ER (2200rpm)  EK-Ekoolant EVO Liquid Coolant EK-XTOP Revo D5 PWM Pump Windows 10 Pro 
MonitorKeyboardPowerCase
Asus VG278H Ducky YOTG Keyboard Corsair AX1200 Corsair Obsidian 800D 
MouseAudioAudioAudio
Logitech G700s Schiit Gungnir Multibit Schiit Mjolnir 2 Schiit LISST 
Audio
Audeze LCD 2 - pre fazor 
CPUMotherboardGraphicsRAM
intel i7 4770K ASRock Z87E-ITX Nvidia Geforce GTX Titan X GSkill F3-2400C10D-16GTX R 
Hard DriveOptical DriveCoolingOS
Samsung 840 Pro 512GB Silverstone 12.7mm Slot Load Blu-Ray Burner Noctua NH-L12 Windows 8 Pro 
MonitorCaseAudioAudio
LG PA75U Slim LED Projector Silverstone SG08 Schiit Bifrost Schiit Asgard 2 
AudioOther
AKG Q701 Headphones Pelican 1510 Green Case  
  hide details  
Reply
 
Tragbar
(14 items)
 
 
CPUMotherboardGraphicsRAM
Ryzen 1800X Asus Crosshair VI Hero Nvidia Geforce Titan X F4-3600C15D-16GTZ 
Hard DriveHard DriveHard DriveHard Drive
Combined: 6.13 TB of space Samsung SSD 960 EVO 500GB Crucial_CT1050MX300SSD1 M4-CT128M4SSD2 
CoolingCoolingCoolingCooling
EK-Supremacy EVO White Edition PrimoChill PrimoFlex Advanced LRT EK-RES X4 250 (R2.0) Reservoir EK-CoolStream XE 360 
CoolingCoolingCoolingOS
EK-Vardar F4-120ER (2200rpm)  EK-Ekoolant EVO Liquid Coolant EK-XTOP Revo D5 PWM Pump Windows 10 Pro 
MonitorKeyboardPowerCase
Asus VG278H Ducky YOTG Keyboard Corsair AX1200 Corsair Obsidian 800D 
MouseAudioAudioAudio
Logitech G700s Schiit Gungnir Multibit Schiit Mjolnir 2 Schiit LISST 
Audio
Audeze LCD 2 - pre fazor 
CPUMotherboardGraphicsRAM
intel i7 4770K ASRock Z87E-ITX Nvidia Geforce GTX Titan X GSkill F3-2400C10D-16GTX R 
Hard DriveOptical DriveCoolingOS
Samsung 840 Pro 512GB Silverstone 12.7mm Slot Load Blu-Ray Burner Noctua NH-L12 Windows 8 Pro 
MonitorCaseAudioAudio
LG PA75U Slim LED Projector Silverstone SG08 Schiit Bifrost Schiit Asgard 2 
AudioOther
AKG Q701 Headphones Pelican 1510 Green Case  
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Help with a few small scripts