1/30/2015
Most Important and Useful Windows Scripts Used By Professionals
HOME
SERVICES
Computer
Gadgets
SUBMIT YOUR QUERY!
Gaming
Internet
Mobiles
US
ABOUT
Social Media
Software
Most Important and Useful Windows Scripts Used By Professionals JUNE 6, 2011 BY SA T ISH KUMA R
SEARCH HERE! Search
14 COMMENT S
ADD US TO GOOGLE + CIRCLES! Hi
Job vacancies
All,
Welcome
Professional
to
Coolpctips
Mondays week
#2. After my First post about 10
Important
Must
Suivre
Have
+ 248
Security Group Policies For
What?
Windows
28 rotation
Systems,
I
+1
have
received many concerns about the term Scripts and its uses. I
Where?
came to
know many
are
unaware of the scripts usage and power. We at corporate Look for jobs
+ See all
companies tend to perform same
activities
periodically
across many computers in a
Simply enter your name and e-mail ID below to our mailing list, don't worry, there's not going to be any spam, just stuff you can use!
network and its difficult to run the application or task individually on all the PC’s. So we write certain scripts to automate the process or Application installations and
Name
force them to run through group Policies as discussed in my earlier post at startup or times.A script is nothing but a list of commands that are executed by a
Email
respective programs or scripting mechanisms.
Powered by AWeber
Scripts can be used to automate processes on a PC
► File ► Windows 7 PC ► Batch Dos Script
or to generate Web pages on the Web. For example, DOS scripts and VB Scripts are used to run processes on Windows Operating Systems, and Apple Script scripts can automate tasks on
http://www.coolpctips.com/2011/06/most-important-and-useful-windows-scripts-used-by-professionals/
1/9
1/30/2015
Most Important and Useful Windows Scripts Used By Professionals
Macintosh computers.ASP, JSP, and PHP scripts are used to design and generate Web Pages. In this post I am going to give you some sample scripts prepared using simple DOS commands and VB for advanced s that automate few tasks in windows with less intervention. Please note that you need to have a very good grip over DOS commands to understand few commands that I used in scripts. You can copy the below commands to a notepad and save the file with the relevant name and save the file name as example.bat (batch Script) Example.cmd (command Script).
PowerShell ASP powershellserver.com
Build Dynamic Web Content with PowerShell with ASP-Style Scripting
QTP Visual Testing MISRA C: 2012 Nettoyer son Ordinateur Cours d'Anglais Gratuit VBScript Editor for WSH Start (Free) Vidéos et Tutoriels The Hidden Uranium Boom Create Your Own Website
SHUTDOWN/RESTART WINDOWS : For a shortcut to RESTART Windows XP: SHUTDOWN -r -t 01
CATEGORIES Select Category
For a shortcut to SHUT DOWN Windows XP: SHUTDOWN -s -t 01
CLEANUP TEMPORARY FILES AND TEMPORARY INTERNET FILES FOR BETTER PERFORMANCE (WITH MENU) : ECHO OFF CLS :MENU ECHO. ECHO ……………………………………….. ECHO PRESS 1 or 2 or 3 or 4 or 5 or 6 to select your task, or 7 to EXIT. ECHO ……………………………………….. ECHO. ECHO 1 – DELETE COOKIES ECHO 2 – DELETE RECENT DOCUMENTS LIST ECHO 3 – DELETE MY TEMP ECHO 4 – DELETE MY TEMP INTERNET FILES ECHO 5 – DELETE SYSTEM TEMP ECHO 6 – DELETE RECYCLE BIN ECHO 7 – EXIT ECHO. http://www.coolpctips.com/2011/06/most-important-and-useful-windows-scripts-used-by-professionals/
2/9
1/30/2015
Most Important and Useful Windows Scripts Used By Professionals
SET /P M=Type 1, 2, 3, 4, 5, 6 or 7 then press ENTER: IF %M%==1 GOTO DELETE COOKIES IF %M%==2 GOTO RECENT DOCUMENTS LIST IF %M%==3 GOTO MY TEMP IF %M%==4 GOTO MY TEMP INTERNET FILES IF %M%==5 GOTO SYSTEM TEMP IF %M%==6 GOTO RECYCLE BIN IF %M%==7 GOTO EXIT : DELETE COOKIES (no space between : and D) del /F /S /Q C:\docume~1\%NAME%\cookies\*.* GOTO MENU :RECENT DOCUMENTS LIST del /F /S /Q C:\docume~1\%NAME%\recent\*.* GOTO MENU :MY TEMP del /F /S /Q C:\docume~1\%NAME%\locals~1\temp\*.* GOTO MENU :MY TEMP INTERNET FILES del /F /S /Q C:\docume~1\%NAME%\locals~1\tempor~1\*.* GOTO MENU :SYSTEM TEMP del /F /S /Q %SystemRoot%\temp\*.* GOTO MENU :RECYCLE BIN REM del /F /S /Q C:\recycler\*.* GOTO MENU
Please note to change the Path with your own path for your profile if you are using windows 7. This one is optimized for windows xp. If any doubts, you can always ping me.
CLEANUP TEMPORARY FILES AND TEMPORARY INTERNET FILES FOR BETTER PERFORMANCE (WITHOUT MENU). rem @ECHO OFF SET SRC1=C:\Documents and Settings SET SRC2=Local Settings\Temporary Internet Files\Content.IE5 SET SRC3=Local Settings\History SET SRC4=Local Settings\Temp SET SRC5=Recent echo About to delete files from Internet Explorer “Temporary Internet files” http://www.coolpctips.com/2011/06/most-important-and-useful-windows-scripts-used-by-professionals/
3/9
1/30/2015
Most Important and Useful Windows Scripts Used By Professionals
FOR /D %%X IN (“%SRC1%\*”) DO FOR /D %%Y IN (“%%X\%SRC2%\*.*”) DO RMDIR /S /Q “%%Y” echo About to delete files from Internet Explorer “History” FOR /D %%X IN (“%SRC1%\*”) DO FOR /D %%Y IN (“%%X\%SRC3%\*.*”) DO RMDIR /S /Q “%%Y” FOR /D %%X IN (“%SRC1%\*”) DO FOR %%Y IN (“%%X\%SRC3%\*.*”) DO DEL /F /S /Q “%%Y” echo About to delete files from “Local settings\temp” FOR /D %%X IN (“%SRC1%\*”) DO FOR /D %%Y IN (“%%X\%SRC4%\*.*”) DO RMDIR /S /Q “%%Y” FOR /D %%X IN (“%SRC1%\*”) DO FOR %%Y IN (“%%X\%SRC4%\*.*”) DO DEL /F /S /Q “%%Y” echo About to delete files from “Recent” i.e. what appears in Start/Documents/My Documents FOR /D %%X IN (“%SRC1%\*”) DO FOR %%Y IN (“%%X\%SRC5%\*.lnk”) DO DEL /F /S /Q “%%Y” echo About to delete files from “Windows\Temp” cd /d %SystemRoot%\temp del /F /Q *.* @echo Y|RD /S “” This can be placed in the “” tab according to my previous post for cleaning the junk in the disk soon after you to your PC. Please note to change the Path with your own path for your profile if you are using windows 7. This one is optimized for windows xp.
INSTALL MSI PACKAGES WITHOUT YOUR MUCH INVOLVEMENT : You all stuff from internet, I too do it periodically…at office we Microsoft updates to be installed in the systems. while installing it becomes a pain for us to keep on clicking on next>next>Finish button at each systems which are time consuming. So to avid them..Just follow the below commands in the same format. Example: Internet Explorer setup9.exe –z –m Or Internet Explorer setup9.msi –z –m Above commands are applicable only if you are going to install a update or setup file similar to IE5,6,7,8,9 setups. This wont popup any window but just installs them in the background.
SCRIPT TO DISPLAY OS VERSION DETAILS (VBSCRIPT): Paste the code in notepad and save the file as Version.vbs strComputer = “.” Set objWMIService = GetObject(“winmgmts:” _ & “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2″) Set colOSes = objWMIService.ExecQuery(“Select * from Win32_OperatingSystem”) For Each objOS in colOSes Wscript.Echo “Computer Name: ” & objOS.CSName Wscript.Echo “Caption: ” & objOS.Caption ‘Name http://www.coolpctips.com/2011/06/most-important-and-useful-windows-scripts-used-by-professionals/
4/9
1/30/2015
Most Important and Useful Windows Scripts Used By Professionals
Wscript.Echo “Version: ” & objOS.Version ‘Version & build Wscript.Echo “Build Number: ” & objOS.BuildNumber ‘Build Wscript.Echo “Build Type: ” & objOS.BuildType Wscript.Echo “OS Type: ” & objOS.OSType Wscript.Echo “Other Type Description: ” & objOS.OtherTypeDescription WScript.Echo “Service Pack: ” & objOS.ServicePackMajorVersion & “.” & _ objOS.ServicePackMinorVersion Next
CLASSIC SHUTDOWN MENU (VBSCRIPT) : ‘Shutdown.vbs – Call Windows shutdown choice popup. set WshShell = wscript.CreateObject(“Shell.Application”) WshShell.ShutdownWindows I can go on like this with many useful scripts…Any of the reader interested in any script to automate your task.
SUBSCRIBE HERE TO GET FREE TOOLS AND KEEP YOUR PC SAFE
Name
Email
SUBSCRIBE
About Satish Kumar Satish Kumar is the Founder of Pyrite Technologies Private Limited. He is very ionate about writing Technology and Troubleshoot issues in CoolPCTips. He also writes at SEOsiren.com on free search engine traffic strategies.
Comments Satish says: June 6, 2011 at 7:37 PM
Awesome Stuff Subhash
W ow ! man this is really awesome stuff. I loved it
Thanks Pro ! Reply
http://www.coolpctips.com/2011/06/most-important-and-useful-windows-scripts-used-by-professionals/
5/9
1/30/2015
Most Important and Useful Windows Scripts Used By Professionals parbat says: June 6, 2011 at 8:25 PM
very very nice, thanks Reply
Srikanth Rao says: June 6, 2011 at 9:23 PM
Yea really cool scripts and here one think i am not clear is with the FOR conditional loop in the script.. Can u please ex plain it..! Reply
subbuaxel says: June 7, 2011 at 7:37 AM
In which script? and as i told you unless u are familiar with the dos commands you wont be understanding the command parameters even if i tell you abt the for loop! Reply
Srikanth Rao says: June 7, 2011 at 8:17 AM
In Cleanup Temporary Files and Temporary Internet Files for better performance (W ithout Menu) script..! Just tell in an odd way sir i can get it..! Reply
subbuaxel says: June 7, 2011 at 8:52 AM
You cant call it a for loop but,Im just defining that for SCR1(consider as source1) “parent profiles folder” im just asking it to delete the SCR2 folder contents. Syntax : “FOR /D %variable IN (set) DO command [command-parameters]” – If set contains wildcards, then specifies to match against directory names instead of file names. Above syntax check for the profile directory and deletes the folder or its contents forthe set defined in the parameters. I dont know whether u understood it but …hope u get it Reply
subbuaxel says: June 7, 2011 at 8:53 AM
For more details you can just check the command prompt..all i have used is simple commands that are confusing you… check for ” FOR /?” in the command prompt..u wud understand it
http://www.coolpctips.com/2011/06/most-important-and-useful-windows-scripts-used-by-professionals/
6/9
1/30/2015
Most Important and Useful Windows Scripts Used By Professionals
VJ says: June 7, 2011 at 11:28 AM
*Shutting down 100 times faster: -Press ctrl alt del -open task Manager -click the shutdown Tab. -W hile holding ctrl key, -Press TURN OFF. Yes, I like scripts about DOS. Reply
Subhash says: June 7, 2011 at 12:51 PM
W hat if you need a shortcut on desktop with all the options….?Think in that aspect!!! Reply
subbuaxel says: June 7, 2011 at 9:36 PM
whats new in that? we all are in here to know new things right? There are few circumstances where you need another way.Also my script gives you a popup to shutdown,restart,logoff etc…just place a shortcut on the desktop and as per you its more than 100% faster
Reply
shenoyjoseph says: June 7, 2011 at 4:01 PM
easy way to clean all temporary files to speed up system booting in windows.:) Reply
Y8 says: June 14, 2011 at 7:20 PM
Their are lots of software that can automate all this task right now and sometimes some anti-virus right now incorporated this features to their products and softwares. Reply
sushil says: August 2, 2011 at 9:05 PM
i saw your website today and found very useful articles related to batch file. i have 2 problems related to batch programming.i thought you solve my problem so i post to you. 1.i want to change home page of all my browser with a single click.i know http://www.coolpctips.com/2011/06/most-important-and-useful-windows-scripts-used-by-professionals/
7/9
1/30/2015
Most Important and Useful Windows Scripts Used By Professionals
it can be done with batch file but i don’t know how to do it.plz solve this problem. 2.i have idea net setter e1550 when i connect to internet using this then it open ideacellular.com every time.so plz solve this problem also. i hope you reply to these query. regard, sushil Reply
krunal says: July 17, 2012 at 1:54 AM
I’m using Tikona internet. I’m daily getting an error while speed test or while ing the files “The test returned an error while trying to read the file” what kind of error is this, pls help me. Reply
Speak Your Mind Name * Email * Website
Post Comment
RETURN TO TOP OF PAGE
http://www.coolpctips.com/2011/06/most-important-and-useful-windows-scripts-used-by-professionals/
© COOLPCTIPS 2013 | SEO POW ERED BY SEOSIREN.CO
8/9
1/30/2015
Most Important and Useful Windows Scripts Used By Professionals
http://www.coolpctips.com/2011/06/most-important-and-useful-windows-scripts-used-by-professionals/
9/9