Thursday, February 21, 2008

Useful software to get your dynamic ipaddress on Windows 2000 reboots


Download the sendEmail.exe from http://caspian.dotconf.net/menu/Software/SendEmail/
and put it in some directory and make sure you update the setup.bat file accordingly to reflect the proper directory paths as can be seen below:




Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>cd C:\Devel\sendemail

C:\Devel\sendemail>dir
Volume in drive C has no label.
Volume Serial Number is 7472-D5BA

Directory of C:\Devel\sendemail

02/20/2008 03:12p .
02/20/2008 03:12p ..
12/21/2006 07:14a 1,531,966 sendEmail.exe
02/20/2008 03:16p 241 sendip.bat
02/21/2008 05:54p 294 ipmsg

C:\Devel\sendemail>type sendip.bat
ipconfig > "C:\Devel\sendemail\ipmsg"
"C:\Devel\sendemail\sendEmail.exe" -f sendmail@kns.com -t yourEmailID@yourcompany.com -u "New ip address" -s rgmapacsmtp.kns.com -o tls=auto -o message-file="C:\Devel\sendemail\ipmsg"

C:\Devel\sendemail>




Now go to your Start --> Settings --> Control Panel --> Scheduled Tasks --> Add Scheduled Task and create a new task in the next window, Browse for location of sendip.bat -> Select "When my Computer Starts" -> Enter your password .

You need to edit the c:\sendmail\sendip.bat and instead of yourEmailID@yourcompany.com put your company's Email-ID .
and instead of rgmapacsmtp.kns.com you need to give you company's smtp server.

Great now you will get your dynamic ip emailed to you when you require to connect to your machine in future.

Remote Desktop or Netmeeting for Windows 2000 Prof. sucks big time

Better to go with tightVNC and tlntadmn on Windows 2000 Prof.


This is how you do it:
Download the TightVNC server and unzip the package to a directory say C:\tgtvnc

now run the below:


C:\tgtvnc> WinVNC -install --> which will install the service.
C:\tgtvnc>net start winvnc --> which will start the service.


Also open up the Start -> settings -> Control Panel --> Administrative Tools --> Services window and make sure "VNC Server" the "Startup Type" is Automatic so on reboot you winvnc starts up also.

Now for you back just in case winvnc fails on you and you need to start it up again.
For this we have the tlntadmn command to start you telnet server on Windows 2000.

As below:


C:\>tlntadmn


Microsoft (R) Windows 2000 (TM) (Build 2195)
Telnet Server Admin (Build 5.00.99201.1)

Select one of the following options:


0) Quit this application
1) List the current users
2) Terminate a user session ...
3) Display / change registry settings ...
4) Start the service
5) Stop the service

Type an option number [0 - 5] to select that option: 3


Select one of the following options:

0) Exit this menu
1) AllowTrustedDomain
2) AltKeyMapping
3) DefaultDomain
4) DefaultShell
5) LoginScript
6) MaxFailedLogins
7) NTLM
8) TelnetPort
Type an option number [0 - 8] to select that option: 7
Current value of NTLM = 0
Do you want to change this value ? [y/n]y
NTLM [ current value = 0; acceptable values 0, 1 or 2 ] :0
Are you sure you want to set NTLM to : 0 ? [y/n]y

setting will take effect only when Telnet Service is re-started


Select one of the following options:

0) Exit this menu
1) AllowTrustedDomain
2) AltKeyMapping
3) DefaultDomain
4) DefaultShell
5) LoginScript
6) MaxFailedLogins
7) NTLM
8) TelnetPort
Type an option number [0 - 8] to select that option: 0

Select one of the following options:


0) Quit this application
1) List the current users
2) Terminate a user session ...
3) Display / change registry settings ...
4) Start the service
5) Stop the service

Type an option number [0 - 5] to select that option: 4
Starting Microsoft Telnet Service ...
Microsoft Telnet Service started successfully

Select one of the following options:


0) Quit this application
1) List the current users
2) Terminate a user session ...
3) Display / change registry settings ...
4) Start the service
5) Stop the service

Type an option number [0 - 5] to select that option: 0

C:\>

Now again to make sure your telnet server comes up on reboot as above in the
Services window change for "Telnet" the "Startup Type" to Automatic.

That's it now you can telnet to you Windows 2000 box using:


bash-3.00$ telnet 10.177.247.50
Trying 10.177.247.50...
Connected to dhcp-v412-10-177-247-52.kns.com (10.177.247.50).
Escape character is '^]'.
Microsoft (R) Windows (TM) Version 5.00 (Build 2195)
Welcome to Microsoft Telnet Service
Telnet Server Build 5.00.99206.1
login: srikanth
password: ********

*===============================================================
Welcome to Microsoft Telnet Server.
*===============================================================
C:\>net stop winvnc
The VNC Server service is stopping..
The VNC Server service was stopped successfully.


C:\>net start winvnc
The VNC Server service is starting.
The VNC Server service was started successfully.


C:\>exit

Note sometime you might have to use Shift-Backspace for the Backspace to work for you.

How to delete Windows 2000 services entries

Download the delsrv.exe for windows and run delsrv serive_name.

Remind you just deleting the entry in registry is not the proper way to do it.

Tuesday, February 19, 2008

Instead of Reinstalling Windows 2000 and your applications on blue screen or other crashes

To recover from a corrupted filesystem/files on your windows C: filesystem
you can do the below:

Make partitions of FAT32 30GB each for C: D: etc,
After you have installed all the required software make a linux ext3 filesystem
to tar up your C: dirs/files and you can untar them back whenever required.

Here is the process below:
boot up with puppylinux3.01 and do
cfdisk /dev/hda --> here hda could be some other like hdc or hdb
select new partition on the /dev/hda1 or whatever you have no filesystem on.
the select type and change the type to Linux(83) filesystem
finally write the filesystem to disk, becarefull at this point and don't mess up your windows partitions.
then finally format it to a ext3 filesystem which is usable with mkfs as below:
mkfs -t ext3 /dev/hda3 --> again hda3 can be hda5 or whatever your used in cfdisk

Now your ready to tar up your c: directories and files as below:
You will have Drives Icon on the puppy desktop select it.
you will see that you /dev/hda3 got created. Now you need mount both of these
files systems i.e. is the /dev/hda1 with your windows c: in it and your newly created
linux ext3 filesystem.
Just click on the icons with disk drive images on them to mount both drives.
You can observe the got mounted on your /mnt/hda1 and /mnt/hda3 locations:
Now open up your Console Terminal
cd /mnt/hda1 --> that is your windows location.
tar -cf /mnt/hda3/win2kcdrv.tar *

That's it.
So next time say your drive got screwed up just boot up with puppy linux, mount
your drives delete your "Program Files" "WINNT" or any other files you think might have got corrupted and recover you windows system.

You can use the procedure below to extract and copy files back to your c:
lets as above your c: is on /mnt/hda1
cd /mnt/hda1
mkdir recover; cd recover
tar -xf /mnt/hda3/win2kcdrv.tar

No you will find all your driectories in /mnt/hda3/recover where you can manually copy the required files or directories :).