Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Configuration Script and Home Basic performance

21 Aug 2010   #11



Are you wanting these scripts to be launched after a new install of Windows 7, or is the purpose to check settings and reset them to your custom values, on an os that has alreay been installed and is already in use?

My System SpecsSystem Spec
21 Aug 2010   #12
noumen arete

Windows 7 x86 Home Basic*

Both, because some new installs will "require" some but not all modifications, and the same for a system that is already in use. It depends mostly on the user.

About the security vulnerabilities, I actually use ESET SS, because I have a lot of control on what can or can't occur. And I think I didn't explain myself very well, I turn all notifications off to make things more simple for most people, I turn security features off because I believe software like ESET SS will provide enough protection for the regular user.

If you guys say some of these settings are better left untouched, I'll keep them turned on. I just like to get the most out of a system by turning off things that aren't really needed.
My System SpecsSystem Spec
21 Aug 2010   #13

Windows 7 Professional SP1 64-bit

The thing is, Windows Updates are needed. Most users on the site use one realtime AV, one on-demand scanner, a firewall, image their computer regularly, install security updates as soon as they are available, and take other precautions to avoid infection. Still, some of us get viruses from time to time (hence the imaging), so, you can never be too safe. Unless you try to use two real-time AV's, which can cause all kinds of problems.
My System SpecsSystem Spec

21 Aug 2010   #14


Ok, I mean they are your systems, to a degree, and its really up to you. But you should check out this site here: Apni Tanhai Hacking! to get an idea of the kind of people, and the skill level these people have at coding, who are out to pawn your systems. Just having Eset really doesn't give you total protection.

Believe me, it is nothing for these guys to whip up some brand new code, that ESET has never seen, and release it on the world. It happens every single day. And the thing that they look for is errors in the way windows work. If you've never really examined something like that, you should check this out: Insecure Temp File Error in Wine DLL

This is an example of a system loading a file and insecurely creating a temporary file. It's insecure because the system is inadvertently dumping the contents of a protected file that stores your passwords in Windows. The funny thing is, we are tracking down a guy right now who uses this code in a 0-day malware outbreak that we saw at work.

Long story short is, when these sorts of errors are detected, Windows starts working on a fix, and when the fix is found, they patch it, and you are no longer vulnerable. But if you don't patch it, then someone is just going to load up MetaSploit (see here if you never heard of it ), scan your PC for known vulnerabilities and launch attacks at you.

In fact, and I say all this to encourage you to rethink your patching philosophy, do not put it past a reasonably smart hacker to search Google for phrases like "I don't patch" or "we didn't patch because." They might just find your post, and start trying to track you down and "footprint" you, to try some attacks.

So I encourage you to always patch your systems, that's how you lower your risk. I understand your point of view, I actually shared that POV some years ago, but time has shown me the light

Ok, let me finish up on your script tutorial now
My System SpecsSystem Spec
21 Aug 2010   #15

Windows 7 Professional SP1 64-bit

I just wanted to add real quick, I don't recommend setting updates to automatic. I always set it for "Tell me when new updates are available, but do not download or install anything" or something to that degree. Sometimes non-security related updates cause problems, so you want to know what is being installed first.
My System SpecsSystem Spec
21 Aug 2010   #16


Yes, all those things can be automated. And I'm feeling extra techy today, so I'm going to go ahead and write this script with you and share some scripting love. The first thing you should know, if you don't already know it, is that a script is nothing but a bunch of command line commands saved with the .bat extension. However, to be effective, you do need to read the commands and learn them.
A complete list of XP commands, most if not all are still available in Win7 Microsoft Corporation Command Line Commands
A complete list of Windows 7 commands: Windows 7 Commands
Also, please note that the script you want to write is fairly complex, so I'm not going to write it for you. But I will assist you with it and will answer each question or problem, if you really want to put in the work.

I'll address each item you've listed in turn, but let's cover some foundational stuff first.

Since you already know that for your script to run you need to save it with the .bat extension, here are some other things to know.

1) For any command, type the command name and /? to get more info about it. Example IF /? is going to print out a big help file on how to use the if command.

2) User either REM (with at least one space character after that word) at the beginning of a line, or use the double colon :: at the beginning of a line to mark a line as a comment. A comment is simply like a note to yourself. It won't be parsed by the command interpreter and won't be executed when the script runs. It's just a way for you to organize your content, or remind yourself what a certain section of code is doing.

:: Navigate to the System32 drive, list all files and print files that start with vtt
cd "C:\Windows\System32
Dir /B /S C:\vtt*
:: This code features the DIR command which tells Windows to list all the files in
:: The current directory. It also features the CD command, which is how you 
:: Change Directories
:: The /B and /S are called switches, also known as options, and they allow you
:: to perform other actions with the command. The /B switch tells windows to print 
:: the full path of the file, not just the name of the file. The /S switch tells windows 
:: to also search inside any folders it finds within the System32 folder.
2) You should download NotePad++. This is like notepad on steroids, and it will automatically color code your batch file commands for you. For instance, it will place comments in green, labels in in RED, etc. This make it a lot easier to spot a mistake.
It also has a billion other useful commands when working with text of any kind.

3) When you are writing out a path with spaces in it, such as C:\Windows\All My Files, you need to remember to wrap that Path name in quotes, otherwise windows will tell you that it can't find the folder.

:: Proper way to write path 
"C:\Windows\Sysmtem32\What A Lot Of Spaces In A Folder\Hereismyfile.txt"
::Bad way to write path
C:\Windows\Sysmtem32\What A Lot Of Spaces In A Folder\Hereismyfile.txt
Disclaimer: I've been writing scripts and working with windows for a long time, but I just migrated to windows 7, and so I'm still catching up on some of the changes. Keep in mind that I may refer to a path like My Documents, which I know is now just called Documents in Windows 7, but old habits are hard to break.

Ok, so let's start to look at your requirements and how we can accomplish them in a batch script.

1) Desktop Items

There are really two things to note when it comes to configuring the desktop.

1. Use vLite, which is the Vista / Windows 7 version of nLite to configure your environment. nLite /vLite software will let you set up everything you want about your system, including what items you want on the desktop, what services you want to uninstall, what updates, service packs, or hotfixes you want to include, etc. When you're done you can burn an unattended install DVD or CD-ROM and have a ready to go image for deployment. You can also add scripts to be ran after the install, and it will sign you into whatever account and run the scripts for you.

What they don't do, sadly, is let you simply place certain shortcuts on the desktop. But they do let you run scripts. So, long story short, what you want to do write a script to either detect if a shortcut exist, and if not place it on the desktop.

Note that when you copy your shortcuts to the vLite folder of your choice, you want to use environment variable paths, and not explicit path names. In other words, I can use the environment variable for a user's directory like this %USERPROFILE% and that refers to the PATH C:\Users\{username}. So I don't need to know the name of the user, I just need to use the variable called %USERPROFILE% with a \Desktop to reach their desktop. Code example below:

:: Creating a shortcut on the user's desktop, only if it is not there already. 
IF Exist Shortcut1.lnk ( echo The file Shortcut 1 already exist ) Else ( xcopy "E:\I386\CustomFiles\Shortcuts\Shortcut1.lnk" "%USERPROFILE%\Desktop\Shortcut1.lnk )
::Creating shortcut 2
IF Exist Shortcut2.lnk ( echo The file Shortcut 2 already exist ) Else (  xcopy "E:\I386\CustomFiles\Shortcuts\Shortcut1.lnk"  "%USERPROFILE%\Desktop\Shortcut1.lnk )
::The IF and optional Else command is used to test if a condition is true or not. It can also compare ::the relationship between something, as in one number be greater or less than 
::another. It has a lot of functions, so definitely read up on it.
:The echo command is used to print strings (or text) to the standard output
::And the standard output in this case is the command line window.
::The xcopy command is used to copy files from a source to a destination
::The basic format of the command is xcopy source destination 
::Where the source is the path of the file/ directory you are copying and the
::Destination is where you are copying it to.
Configuring the task bar and notifications can be done through vLite and disabling Aero can also. If you want to configure services, you need to use the SC command, which stands for Service Controller.

Show 8 programs
Show only DOCUMENTS, COMPUTER, CONTROL PANEL and RUN on the right side.

All of that can be done in vLite.

In scripting, things always come down to three ways of changing settings. Either you need to run some commands, Edit the registry, or copy a custom file to a certain folder. Now, I don't have enough energy to list where all these things in the registry would be, but I'll provide one example and then afterward you just need to start Googling for things like "Where are the task bar settings located in the registry?"

Windows 7 Task Bar Settings In Registry: Have a look at this article here

Now, I know some people are worried about editing the registry. You don't strike me as that type, but if you are, then you might as well stop reading right now. But if you want to really learn Windows, and how to automate everything, then you'll need to become familiar and comfortable with it. But you'll love the fact that you did.

It is important to do a backup of your registry, but you don't need to backup the whole thing. Each time you edit a key (any folder) just right click it and do a backup, if something goes wrong (which it almost never does) then do an import and it will overwrite whatever you did.

Ok, so there is a command line tool for editing the registry. It's called Reg. Some example commands would be: To query for the existence of a key REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"

or to add a key to the registry

REG ADD HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

There are many switches that you can use with the REG command, so definitely read the article first.

The thing about the reg command, and others like it, is that to really be effective, you need to be able to parse (look through) the output of a command and then do something with that data. If you run ipconfig in the command line, for instance, you will get your IP address, but you would get a bunch of other data too.

If you needed to write a script that used ipconfig to get the user's IP address only, how would you do that? You'd have to parse through that output, find the ip address, and place it a container of sorts. And you can do all this with the command line.

Getting back to the REG command for a moment, If you run the reg query command above, the command line would spit out something like this


NoDriveTypeAutoRun REG_DWORD 0x91
NoViewContextMenu REG_DWORD 0x0
NoSetTaskbar REG_DWORD 0x0
NoSaveSettings REG_DWORD 0x0
Just like with ipconfig, we need to be able to grab just one piece of data, in this case a particular key, like the NoViewContextMenu item, and determine if it is set to 0x0 or 0x1. Now how could you do that? You'd have to use the FOR command.

It's not hard to use, but it does require that you read about it carefully.

I suggest you read up on it, and then respond to this thread with questions, and I'll get you up to speed on it. Once you know the REG command and once you know how to use the FOR command to find any value within the registry (or within anything else for that matter) , you can go crazy editing the hell out of windows, and custom scripting basically whatever you want. But again, vLite is going to take a lot of that work and do it for you, so if the option is in vLite, I would just do it there.

Disable system restore on all drives
Move page file from disk 1 to disk 2, or partition 2.
Disable some visual effects from system properties
Disable Allow remote assistance
Turn off user access control

Again, all through vLite, and some through the registry. Pagefileconfig is a command line tool, so you don't need to edit the registry.

Disable ALL notifications (security, maintenance, etc)
Disable windows update
Edit some power config options

Notifications and Windows Update are definately in vLite. Power Config actually has to be done in the registry.

Set D:\ (partition 2 or disk 2) as the default "documents" path

You can use the SET command to explicitly declare the default documents path for any environment variable, including the documents path.

Okay, so at this point, its all up to you. You should start working on a script, and whenever you get stuck or have a question, just update this thread with your question and I'll answer it for you. If were lucky then some other scripters might join in and increase both our knowledge
My System SpecsSystem Spec
29 Aug 2010   #17
noumen arete

Windows 7 x86 Home Basic*

Wow dranfu that's a lot of information, I read all the links and found them very interesting, but as you said, there might be other ways to do it more easily, for example I realized that many of Windows settings contained in the registry didn't contain the users name, so they could be exported as reg files and imported in a different machine.

So I tried it, I made a new user account (which has loaded the default settings) then I added the other account's reg files and it kind of worked, while most taskbar options worked, not all visual effects did, it is just a matter of investigating where are all settings stored.

With the information you provided, I believe I'm not yet ready to mess with some kind of scripts, but I'll give those regarding killing and disabling services a try. For the moment, that, and comparing registry files (modified vs modified) to find out where the settings are stored, is what will keep me busy some time.

Thanks agan for the info dranfu.

Petey, sure that's the main reason I don't like windows update, besause it installs things other than really critical fixes, anyway, I'll set it to download, install later.

I'll keep you informed
My System SpecsSystem Spec
01 Sep 2010   #18


I believe I'm not yet ready to mess with some kind of scripts, but I'll give those regarding killing and disabling services a try
Once you pop, you can't stop. Enjoy your journey
My System SpecsSystem Spec

 Configuration Script and Home Basic performance

Thread Tools

Similar help and support threads
Thread Forum
Home Network Basic Configuration
I have a few questions about simple WIndows 7 home networking. First, here are the various elements I have encounterd (let's leave any domain stuff out of this for now). There's the Workgroup, the LAN network, the wireless network and then the home group. Could someone explain to me how all these...
Network & Sharing
What are the basic Windows 7 pro configuration to be a server?
Hi, this is my first thread. apologize in advance for any mistake. I have IBM server installed with Win 7 pro, i plan to use this as a server and will be connected by 10 PCs. Need a help what are the basic configurations because this is my first time work with server. I believe they are few...
Network & Sharing
Visual Basic Script Change
Someone who knows Visual Basic Scripting, help me with a script that was handed to me, but it's not complete and can use a few adjustments to it. The script is a little advanced, just a forewarning :)
Performance comparison btw. Windows 7 Home Basic versus Home Premium
Hi Please advice on the performance comparison between - Windows 7 Home Basic versus - Windows 7 Home Premium assuming if both uses the same 8GB RAM. Just a hearsay...that Windows 7 Home Basic is lagging behind Windows 7 Home Premium in terms of performance assuming if both uses the...
Performance & Maintenance
Visual basic script doesn't work in gadget
Yes I know we shouldn't be using gadgets, but I simply don't care. I've been using Computer Status (Computer Status Gadget v3.5 by ~drakesteele on deviantART) for the longest time, and all versions have this annoying bug where the uptime part doesn't work, where immediately after booting up it...

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 08:30.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App