Tag: Windows 2000

How to change IP address using a Batch File Script on Windows?

How to change IP address using a Batch File:

Starting with Windows 2000, Microsoft has provided a powerful utility, Netsh, which lets you display and modify the network configuration of Windows computers. You can use the Netsh on the command line or in a batch file. Here’s an example of how you can create a batch file that changes the IP address of the local machine.

Netsh is a command-line scripting utility that allows you to, either locally or remotely, display or modify the network configuration of a computer that is currently running. Netsh also provides a scripting feature that allows you to run a group of commands in batch mode against a specified computer. Netsh can also save a configuration script in a text file for archival purposes or to help you configure other servers.

In my environment, we don’t use DHCP. We use static IP addresses. Using static IP addresses usually doesn’t present any problems because we rarely move desktops between locations. However, the people who use laptops usually visit multiple locations. At each location, they’ve been assigned a separate IP address. Each time they change location, they look up the appropriate network settings in a .txt file, then manually change those settings. This occasionally creates problems because they have to remember the correct steps to change their network settings and sometimes they mistakenly enter wrong numbers.

I found a solution. For each location, I created a simple batch file that the laptop users can run. Whenever they want to change their IP settings, all they have to do is execute the appropriate batch file.

The batch file uses the Netsh utility and contains below given commands.

Copy the code given below in the Notepad and save it with the .bat extension.

– Run the .bat file with double click.

– In the some cases, the .bat file needs to run with administrator’s privileges. Right-click on the .bat file and choose “Run as administrator“.

@echo off
ipconfig /flushdns
ipconfig /release
netsh interface set interface "Local Area Connection" disable
netsh interface ip set dns "Local Area Connection" static
netsh interface ip set address "Local Area Connection" static
echo Wait 5 seconds...
ping -n 60 -w 1000 0.0.0.1 > nul
netsh interface set interface "Local Area Connection" enable
netsh interface ip set address "Local Area Connection" static 192.168.XXX.XX 255.255.255.0 192.168.XXX.X
netsh interface ip set dns "Local Area Connection" static 192.168.XXX.XXX

To change the IP Address to “obtain an IP address automatically” or to remove the IP Address, Copy the code given below in the Notepad and save it with the .bat extension.


@echo off

ipconfig /flushdns

ipconfig /release

netsh interface set interface "Local Area Connection" disable

netsh interface ip set dns "Local Area Connection" dhcp

netsh interface ip set address "Local Area Connection" dhcp

echo Wait 5 seconds...

ping -n 60 -w 1000 0.0.0.1 > nul

netsh interface set interface "Local Area Connection" enable

Now, whenever the users want to change their IP settings, all they have to do is run the batch file.

 Note: This entire process (IP Address change process) will take max 60 to 80 seconds.

Source: windowsitpro, sevenforums

 

How to Remotely Enable Remote Desktop (Terminal Services or RDP) via Registry in Windows 2000/XP/2000/Vista/2008

Remote Desktop or RDP service is a free yet useful tool to remotely log on to remote computer and gain full access and privileges as if user is in front of local console. Remote Desktop is also known as Terminal Services. It’s useful if the server, or PC, is located miles away in remote location and frequent trips to the site to troubleshoot, configure or manage the system is not a viable option.

Although most versions of Windows operating system such as Windows 2000, 2003, 2008, XP and Vista do come packaged with Remote Desktop, it’s disabled by default. Turning on and enabling the Remote Desktop via local console is easy, where Microsoft provides similar GUI (graphical user interface) in all editions of Windows.

However, if an off-site server needs to be accessed via Remote Desktop Connection (RDC) client immediately, when the Remote Desktop is not enabled on the server, then it will be a headache. Luckily it’s possible to remotely enable and turn on the Remote Desktop service on a remote PC or server by remotely editing its registry.

To remotely enable Remote Desktop on another computer, follow these steps:

  1. Login to theworkstationwith administrator credentials.
  2. Run Registry Editor (regedit).
  3. Click on File menu.
  4. Select the Connect Network Registry in the pull down menu (see Figure 1).
Figure 1

5.    A “Select Computer” dialog search box is opened. Type the host name of the remote computer in the text box, or browse Active Directory to locate the remote server, or click on “Advanced” button to search for the remote computer (see Figure 2).

Figure 2

6.   Click OK after the remote computer is selected. A node for the remote computer network registry will be displayed in the Registry Editor with HKEY_LOCAL_MACHINE (HKLM) and HKEY_USERS (HKU) hives (see Figure 3).

Figure 3

7.   Navigate to the following registry key for the remote computer:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server


8.   In the right pane, locate a REG_DWORD value named fDenyTSConnection. Double-click on fDenyTSConnection and change the value data from 1 (Remote Desktop disabled) to 0 (Remote Desktop enabled) (see Figure 4 & Figure 5)

Figure 4
Figure 5

9.   Reboot the remote machine by issuing the following command in Command Prompt:

shutdown -m \\hostname -r

10 .  Replace host name with the actual computer name of the remote host.

Once host pc/server is restarted, you can connect through RDC.

Source: My digital life

PC in PC

Microsoft Virtual PC 2007 allows users to run multiple operating systems conveniently on a single computer. Users can switch operating systems as easily as they switch applications on a mouse click. Each virtual machine acts like a standalone computer.

Since each VM runs its own operating system, users can install and run x86 operating systems.

Microsoft fully supports the following operating systems running in a virtual machine on Virtual PC:

But users can also install Windows 2000/2003 Server systems, Linux builds and other operating systems.

The operating system that runs on the physical computer is called the Host operating system and the operating systems that run on virtual machines are called Guest operating systems.

The main purpose of Virtual PC is to allow the user to run multiple guest machines on one real host machine.

The main advantages of VMs are:

  • Multiple OS environments can co-exist on the same computer, in strong isolation from each other.
  • The virtual machine can provide aninstruction setarchitecture (ISA) that is somewhat different from that of the real machine.
  • With “save state” option, you can hibernate the VM instead of completely shutting it down. That way, you can reactivate a VM without going through the lengthy boot up process.
  • With “undo disks” option, you can discard all changes to the VM when you close a session. That way, you can have the VM start-up exactly the same as it did the previous time.
  • To directly compare competing software products, you can use duplicate VMs to provide identical platforms.
  • The network adapter in a VM gets a different IP address than the host, so you can connect both guest and host to a home network. You can also setup and test a firewall or webserver without using another computer.
  • NIC traffic bypasses host’s firewall.

The main disadvantages of VMs are:

  • A virtual machine is less efficient than a real machine when it accesses the hardware indirectly.
  • The most glaring deficiency, though, is the lack of USB support in the virtual machines. Other than a mouse or keyboard, if you want to use a USB device with Virtual PC, you’re out of luck.
  • Does not support DVD iso images (Note: Does support real DVD disks in host’s DVD drive).

You can download Microsoft Virtual PC 2007 for free from the following link: Virtual PC 2007.

Installing Virtual PC:

1.       Click Setup. Welcome to the installation wizard for Microsoft Virtual PC 2007 screen appears (see Figure-1).

Figure-1

2.       Click Next. License Agreement screen appears (see Figure- 2).

Figure-2

3.       Click Next. Customer Information screen appears (see Figure -3).

Figure-3

4.    Click Next. Ready to Install the Program screen appears (see Figure-4).

Figure-4

5. Click Install. Installing Microsoft virtual PC 2007 screen (see Figure-5) followed by Installation Complete screen appears (see Figure-6).

Figure-5
Figure-6

6.       Click Finish to complete the installation.

7.       Go to Start >> All Programs>>Microsoft Virtual PC (see Figure-7).

Figure-7

New Virtual Machine screen appears (see Figure-8).



Figure-8

8.       Click Next. Options screen appears (see Figure-9)

Figure-9

9.       Select an option to create a new virtual machine.

10.       Click Next. Virtual Machine Name and Location screen appears (see Figure-10).

Figure-10

11.       Enter name of the virtual machine in Name and Location field.

12.       Click Next. Operating System screen appears (see Figure-11).

Figure-11

13.       Select an operating system that you are going to install from Operating System list that displays all the operating systems the Microsoft Virtual PC supports.

14.       Click Next. Memory (RAM Configuration) screen appears (see Figure-12).

Figure-12

15.       Set the RAM for the virtual machine.

16.       Click Next. Virtual Hard Disk Options screen appears (see Figure-13).

Figure-13

17.       Select ‘A new virtual hard disk’ option.

18.       Click Next. Virtual Hard Disk Location screen appears (see Figure-14).

Figure-14

19.       Click Next It prompts you to specify the path where new .vhd should be created and completing the New Virtual Machine Wizard screen appears (see Figure-15 ).

Note: This will be the same folder as where your .vmc file resides by default but all.vhd files are stored on a separate drive for best performance a folder named Virtual PC on drive D or E on the Host system.

Figure-15

20.  Click Finish. It creates new VM but no operating system is installed on it.