Posts tagged: Windows Vista

Add a static route to Windows

To add a static route to windows you can use the route command:

To view the existing routes on a machine. Open a command prompt and type the following:

route print

To add a static route:

route add <target> mask <netmask> <gateway IP> metric <metric cost> if <interface>

eg. route add 192.168.1.0 mask 255.255.255.0 10.10.1.1 metric 1

The above static route will only be available till the machine in rebooted. To add a persistane route (one that lives after a reboot of the machine) add the -p switch to the command.

eg. route -p add 192.168.1.0 mask 255.255.255.0 10.10.1.1 metric 1

The following registry key holds the values for static routes.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\PersistentRoutes

As with other command prompt commands you can view all the options this command offers by typing route /? at the command prompt.


  • Share/Bookmark

Moving Firefox from XP to Vista/Win7

To migrate your firefox settings from XP to Windows Vista or Windows 7 you will need to copy the below folder with firefox closed.

“c:\Documents and Settings\ProfileName\Application Data\Mozilla” to “C:\Users\ProfileName\AppData\Roaming”

  • Share/Bookmark

Delete Network Printers using VBScript

The script below will delete all network printers  from the user profile but will not remove any of the local printers. This is quite useful if you have roaming profiles and want to remove mapped printers before running computer/OU specific scripts to map other printers.

You will need to copy the below into a notepad document and save with a .vbs extension.

‘————————————————————————-

‘– Removes all network printers but not any local printers–

‘————————————————————————-

strComputer = “.”
Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2″)

Set colInstalledPrinters =  objWMIService.ExecQuery _
(“Select * from Win32_Printer Where Network = TRUE”)

For Each objPrinter in colInstalledPrinters
objPrinter.Delete_
Next

‘————————————————————————-

I have tested this under Windows XP and Windows 7 and appears to work properly. I don’t have any more Vista machines but it should work fine on that also.

  • Share/Bookmark