Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › .bat file [Optimization]
New Posts  All Forums:Forum Nav:

.bat file [Optimization]

post #1 of 17
Thread Starter 
Ok so I'm a computer technician that's looking to make certain things turn around a lot quicker while here in the shop.

My question is...

Is it possible to write a batch file that would be able to do thing's, such as the following...?


1. Disable Specific Services that a majority of my client's will never need.
2. Automatically change visual settings as well as set to Page File size within windows?
3. Automatically have it silent install programs I have within a Directory? Assuming it could all link using a flash drive...
4. Reset the Icon Cache as it never fails that certain icons will not show up when installing for the first time.
5. Also have it possibly schedule for certain programs to do things at a certain time thereafter... for example
Install C Cleaner -> Run System Clean Up -> Run Registry Clean Up -> End Program
Run System Defrag (CMD) -> Restart
or something along those lines.

This is something I would be extremely interested in doing so if anyone has any clues on how I can get started or if someone already has this done then cool but I wouldn't mind learning how to do it myself.
Naomi
(16 items)
 
  
CPUMotherboardGraphicsGraphics
Intel i5 2500k Asus Maximus IV Extreme EVGA GTX 560 TI SC EVGA GTX 560 TI SC 
RAMHard DriveOptical DriveCooling
x2 4GB DDR3 1600 OCZ Solid 3 SLD3-25SAT3-120G Optiarc BD RW BD-5300S Corsair H100 Liquid Unit 
OSMonitorPowerCase
Windows 7 64-bit Asus 24 Monitor Corsair AX 750 Gold MYOPENPC DOMA Pro PCI Black Transparent Acrylic... 
MouseAudio
Razer Imperator On-Board 
  hide details  
Reply
Naomi
(16 items)
 
  
CPUMotherboardGraphicsGraphics
Intel i5 2500k Asus Maximus IV Extreme EVGA GTX 560 TI SC EVGA GTX 560 TI SC 
RAMHard DriveOptical DriveCooling
x2 4GB DDR3 1600 OCZ Solid 3 SLD3-25SAT3-120G Optiarc BD RW BD-5300S Corsair H100 Liquid Unit 
OSMonitorPowerCase
Windows 7 64-bit Asus 24 Monitor Corsair AX 750 Gold MYOPENPC DOMA Pro PCI Black Transparent Acrylic... 
MouseAudio
Razer Imperator On-Board 
  hide details  
Reply
post #2 of 17
yes I believe it is possibly.
    
CPUMotherboardGraphicsRAM
Intel 3930K 5040MHz @ 1.48 - 1.53v @ VTT/VCCSA ... Asus rampage extreme IV Gigabyte GTX 970 G1 @ 1580/4050MHz @ 1.325V Corsair Vengeance 64GB (8 x 8GB) DDR3 2400MHz. ... 
Hard DriveHard DriveHard DriveHard Drive
Samsung 850 Pro 256GB Seagate Barracuda ST3000DM001 3TB WD Black 1TB 64Mb Cache  WD Blue 500GB 16mb Cache 
Hard DriveOptical DriveCoolingCooling
WD Black 4TB 64mb Cache LG DVD EK-FB KIT RE4 - Acetal EK-FC970 GTX WF3 Backplate - Black 
CoolingCoolingCoolingCooling
Laing D5 Vario 12V DC Pump (MCP 655)  EK-BAY SPIN Reservoir - Plexi EK-CoolStream RAD XT (240) EK-CoolStream RAD XTX (120) 
CoolingCoolingCoolingCooling
EK-CoolStream XE 120 (Single) 8x Corsair Air SP120 PWM High Performance Edition 3x Corsair Air AF120 High Performance Edition EK-Supremacy EVO CPU Water Block (Nickel Acetal) 
CoolingOSMonitorMonitor
EK-FC970 GTX WF3 - Acetal+Nickel Windows 10 64-bit v1511 build 10586.14 BenQ RL2755HM LG W2261 
MonitorKeyboardPowerCase
Samsung S23C350 Razer BlackWidow Ultimate Cooler Master Silent Pro Gold 1000W Thermaltake Level 10 GT 
Mouse
Razer Lachesis 5600DPI 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Intel 3930K 5040MHz @ 1.48 - 1.53v @ VTT/VCCSA ... Asus rampage extreme IV Gigabyte GTX 970 G1 @ 1580/4050MHz @ 1.325V Corsair Vengeance 64GB (8 x 8GB) DDR3 2400MHz. ... 
Hard DriveHard DriveHard DriveHard Drive
Samsung 850 Pro 256GB Seagate Barracuda ST3000DM001 3TB WD Black 1TB 64Mb Cache  WD Blue 500GB 16mb Cache 
Hard DriveOptical DriveCoolingCooling
WD Black 4TB 64mb Cache LG DVD EK-FB KIT RE4 - Acetal EK-FC970 GTX WF3 Backplate - Black 
CoolingCoolingCoolingCooling
Laing D5 Vario 12V DC Pump (MCP 655)  EK-BAY SPIN Reservoir - Plexi EK-CoolStream RAD XT (240) EK-CoolStream RAD XTX (120) 
CoolingCoolingCoolingCooling
EK-CoolStream XE 120 (Single) 8x Corsair Air SP120 PWM High Performance Edition 3x Corsair Air AF120 High Performance Edition EK-Supremacy EVO CPU Water Block (Nickel Acetal) 
CoolingOSMonitorMonitor
EK-FC970 GTX WF3 - Acetal+Nickel Windows 10 64-bit v1511 build 10586.14 BenQ RL2755HM LG W2261 
MonitorKeyboardPowerCase
Samsung S23C350 Razer BlackWidow Ultimate Cooler Master Silent Pro Gold 1000W Thermaltake Level 10 GT 
Mouse
Razer Lachesis 5600DPI 
  hide details  
Reply
post #3 of 17
Thread Starter 
Quote:
Originally Posted by Fantasy View Post

yes I believe it is possibly.

Do you know where I could possibly find this material to create such a thing? O_o
Naomi
(16 items)
 
  
CPUMotherboardGraphicsGraphics
Intel i5 2500k Asus Maximus IV Extreme EVGA GTX 560 TI SC EVGA GTX 560 TI SC 
RAMHard DriveOptical DriveCooling
x2 4GB DDR3 1600 OCZ Solid 3 SLD3-25SAT3-120G Optiarc BD RW BD-5300S Corsair H100 Liquid Unit 
OSMonitorPowerCase
Windows 7 64-bit Asus 24 Monitor Corsair AX 750 Gold MYOPENPC DOMA Pro PCI Black Transparent Acrylic... 
MouseAudio
Razer Imperator On-Board 
  hide details  
Reply
Naomi
(16 items)
 
  
CPUMotherboardGraphicsGraphics
Intel i5 2500k Asus Maximus IV Extreme EVGA GTX 560 TI SC EVGA GTX 560 TI SC 
RAMHard DriveOptical DriveCooling
x2 4GB DDR3 1600 OCZ Solid 3 SLD3-25SAT3-120G Optiarc BD RW BD-5300S Corsair H100 Liquid Unit 
OSMonitorPowerCase
Windows 7 64-bit Asus 24 Monitor Corsair AX 750 Gold MYOPENPC DOMA Pro PCI Black Transparent Acrylic... 
MouseAudio
Razer Imperator On-Board 
  hide details  
Reply
post #4 of 17
Most of these things should be possible. I'm not sure about automation of installation process, you'll have to look at passing parameters to the installer for each program or you may need some external tool like ninite. For other tasks just google the cammands you need to use. E.g.

for running a program or opening a document:
Code:
start setup.exe
start document.doc

for rebuilding icon cache:
Code:
taskkill /IM explorer.exe /F
CD /d %userprofile%\AppData\Local
DEL IconCache.db /a
shutdown /r /f /t 00

for changing page file size:
Code:
REGEDIT4 >> noclick.reg
HKLM\SYSTEM\CCS\Control\Session Manager\Memory Management >> noclick.reg 
"C:\pagefile.sys 700 700" >> noclick.reg
start noclick.reg
buka
(17 items)
 
  
Reply
buka
(17 items)
 
  
Reply
post #5 of 17
Thread Starter 
Quote:
Originally Posted by poroboszcz View Post

Most of these things should be possible. I'm not sure about automation of installation process, you'll have to look at passing parameters to the installer for each program or you may need some external tool like ninite. For other tasks just google the cammands you need to use. E.g.
for running a program or opening a document:
Code:
start setup.exe
start document.doc
for rebuilding icon cache:
Code:
taskkill /IM explorer.exe /F
CD /d %userprofile%\AppData\Local
DEL IconCache.db /a
shutdown /r /f /t 00
for changing page file size:
Code:
REGEDIT4 >> noclick.reg
HKLM\SYSTEM\CCS\Control\Session Manager\Memory Management >> noclick.reg 
"C:\pagefile.sys 700 700" >> noclick.reg
start noclick.reg

That's a good start...
Here's what I'm hoping for.
Warning: Spoiler! (Click to show)
(You open the batch file)
This script will run you through optimizing your computer
..
..
First Disable all Non-Essential Startup programs (Not sure if this can be done or not)
..
..
Next we'll change some Configuration's for your Operating System(Such as allowed maximum processors to start on boot)
..
..
Disable Unneeded services (This for the very basic user mind you and I could go back and re-enable any they might want)
..
..
Next we'll increase your page file size to allow your computer to better function with multiple programs running
..
..
Disable Hibernate (because who actually uses it...)
..
..
Silent Install a set of programs within a root directory that's pre-configured to install from it. (AV Programs, Cleaners, Runtimes, ect...)
..
..
Next We'll Defragment your hard drive to improve performance.
..
..
Check for windows Updates (If Possible?)
..
..
Reset Icon cache
..
..
Restart...

I'm sure I'm missing stuff but this is the basic concept... (Working was bad to I know tongue.gif
Naomi
(16 items)
 
  
CPUMotherboardGraphicsGraphics
Intel i5 2500k Asus Maximus IV Extreme EVGA GTX 560 TI SC EVGA GTX 560 TI SC 
RAMHard DriveOptical DriveCooling
x2 4GB DDR3 1600 OCZ Solid 3 SLD3-25SAT3-120G Optiarc BD RW BD-5300S Corsair H100 Liquid Unit 
OSMonitorPowerCase
Windows 7 64-bit Asus 24 Monitor Corsair AX 750 Gold MYOPENPC DOMA Pro PCI Black Transparent Acrylic... 
MouseAudio
Razer Imperator On-Board 
  hide details  
Reply
Naomi
(16 items)
 
  
CPUMotherboardGraphicsGraphics
Intel i5 2500k Asus Maximus IV Extreme EVGA GTX 560 TI SC EVGA GTX 560 TI SC 
RAMHard DriveOptical DriveCooling
x2 4GB DDR3 1600 OCZ Solid 3 SLD3-25SAT3-120G Optiarc BD RW BD-5300S Corsair H100 Liquid Unit 
OSMonitorPowerCase
Windows 7 64-bit Asus 24 Monitor Corsair AX 750 Gold MYOPENPC DOMA Pro PCI Black Transparent Acrylic... 
MouseAudio
Razer Imperator On-Board 
  hide details  
Reply
post #6 of 17
http://www.piriform.com/docs/ccleaner/advanced-usage/command-line-parameters

I think you can use CCleaner to clear the icon cache too, might be easier then trying to do it via command line.

You can't silently install programs unless they support a silent switch, although it might be possible to get autohotkey to install those programs for you.
Webcrawler
(17 items)
 
  
CPUMotherboardGraphicsRAM
i5 3570k ASRock Z75 Pro3 Sapphire 7870 XT Boost Corsair Vengeance, DDR3 1600Mhz 
Hard DriveHard DriveOSMonitor
SpinPoint F1 1TB 64GB M4 SSD Windows 8.1 SyncMaster P2050 
MonitorKeyboardPowerMouse
Dell U2312HM Sidewinder X4 Be Quiet! Pure Power CM L8 430w Zowie FK 
AudioAudio
Xonar DG Sennheiser HD 555 
  hide details  
Reply
Webcrawler
(17 items)
 
  
CPUMotherboardGraphicsRAM
i5 3570k ASRock Z75 Pro3 Sapphire 7870 XT Boost Corsair Vengeance, DDR3 1600Mhz 
Hard DriveHard DriveOSMonitor
SpinPoint F1 1TB 64GB M4 SSD Windows 8.1 SyncMaster P2050 
MonitorKeyboardPowerMouse
Dell U2312HM Sidewinder X4 Be Quiet! Pure Power CM L8 430w Zowie FK 
AudioAudio
Xonar DG Sennheiser HD 555 
  hide details  
Reply
post #7 of 17
Thread Starter 
Ok well just for the programs, any idea's on how I would start this batch file to lets say. Just install C Cleaner using the /S method for Silent install.
Naomi
(16 items)
 
  
CPUMotherboardGraphicsGraphics
Intel i5 2500k Asus Maximus IV Extreme EVGA GTX 560 TI SC EVGA GTX 560 TI SC 
RAMHard DriveOptical DriveCooling
x2 4GB DDR3 1600 OCZ Solid 3 SLD3-25SAT3-120G Optiarc BD RW BD-5300S Corsair H100 Liquid Unit 
OSMonitorPowerCase
Windows 7 64-bit Asus 24 Monitor Corsair AX 750 Gold MYOPENPC DOMA Pro PCI Black Transparent Acrylic... 
MouseAudio
Razer Imperator On-Board 
  hide details  
Reply
Naomi
(16 items)
 
  
CPUMotherboardGraphicsGraphics
Intel i5 2500k Asus Maximus IV Extreme EVGA GTX 560 TI SC EVGA GTX 560 TI SC 
RAMHard DriveOptical DriveCooling
x2 4GB DDR3 1600 OCZ Solid 3 SLD3-25SAT3-120G Optiarc BD RW BD-5300S Corsair H100 Liquid Unit 
OSMonitorPowerCase
Windows 7 64-bit Asus 24 Monitor Corsair AX 750 Gold MYOPENPC DOMA Pro PCI Black Transparent Acrylic... 
MouseAudio
Razer Imperator On-Board 
  hide details  
Reply
post #8 of 17
I've written that above. Assuming your bat file is in the same folder as the installer:
Code:
start "ccsetup.exe /s"
buka
(17 items)
 
  
Reply
buka
(17 items)
 
  
Reply
post #9 of 17
Thread Starter 
Quote:
Originally Posted by poroboszcz View Post

I've written that above. Assuming your bat file is in the same folder as the installer:
Code:
start "ccsetup.exe /s"
tried that and got nothing...
Naomi
(16 items)
 
  
CPUMotherboardGraphicsGraphics
Intel i5 2500k Asus Maximus IV Extreme EVGA GTX 560 TI SC EVGA GTX 560 TI SC 
RAMHard DriveOptical DriveCooling
x2 4GB DDR3 1600 OCZ Solid 3 SLD3-25SAT3-120G Optiarc BD RW BD-5300S Corsair H100 Liquid Unit 
OSMonitorPowerCase
Windows 7 64-bit Asus 24 Monitor Corsair AX 750 Gold MYOPENPC DOMA Pro PCI Black Transparent Acrylic... 
MouseAudio
Razer Imperator On-Board 
  hide details  
Reply
Naomi
(16 items)
 
  
CPUMotherboardGraphicsGraphics
Intel i5 2500k Asus Maximus IV Extreme EVGA GTX 560 TI SC EVGA GTX 560 TI SC 
RAMHard DriveOptical DriveCooling
x2 4GB DDR3 1600 OCZ Solid 3 SLD3-25SAT3-120G Optiarc BD RW BD-5300S Corsair H100 Liquid Unit 
OSMonitorPowerCase
Windows 7 64-bit Asus 24 Monitor Corsair AX 750 Gold MYOPENPC DOMA Pro PCI Black Transparent Acrylic... 
MouseAudio
Razer Imperator On-Board 
  hide details  
Reply
post #10 of 17
It requires a capital S

btw I would recommend installing the slim version: http://www.piriform.com/ccleaner/download/slim
The other version comes with a toolbar, and it might get installed with the silent installation.

You don't need START either, this works for a custom location:
Code:
ccsetup.exe /S /D=D:\Program Files\CCleaner

I just checked and unfortunatly you cannot rebuild icon cache from within CCleaner, you cannot run reg cleaner via command line either.


Really, check out: http://www.autohotkey.com/

it was made for stuff like this
Edited by .:hybrid:. - 10/18/12 at 11:22am
Webcrawler
(17 items)
 
  
CPUMotherboardGraphicsRAM
i5 3570k ASRock Z75 Pro3 Sapphire 7870 XT Boost Corsair Vengeance, DDR3 1600Mhz 
Hard DriveHard DriveOSMonitor
SpinPoint F1 1TB 64GB M4 SSD Windows 8.1 SyncMaster P2050 
MonitorKeyboardPowerMouse
Dell U2312HM Sidewinder X4 Be Quiet! Pure Power CM L8 430w Zowie FK 
AudioAudio
Xonar DG Sennheiser HD 555 
  hide details  
Reply
Webcrawler
(17 items)
 
  
CPUMotherboardGraphicsRAM
i5 3570k ASRock Z75 Pro3 Sapphire 7870 XT Boost Corsair Vengeance, DDR3 1600Mhz 
Hard DriveHard DriveOSMonitor
SpinPoint F1 1TB 64GB M4 SSD Windows 8.1 SyncMaster P2050 
MonitorKeyboardPowerMouse
Dell U2312HM Sidewinder X4 Be Quiet! Pure Power CM L8 430w Zowie FK 
AudioAudio
Xonar DG Sennheiser HD 555 
  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 › .bat file [Optimization]