Monday, January 1, 2007

1.Windows:
Remote desktop from a command line or batch file:

You can script a remote desktop connection, as Windows XP's remote desktop connection has an executable file that can accept command line parameters and be run from a batch file. The remote desktop connection executable file is MSTSC.EXE, and the following are some of the most common parameters:
· /v:<computername>--specifies the name of the computer to connect to.
. /v:<ipaddress> -- specifies the ip address of the computer to connect to.
· /f--starts the connection in a full screen.
· /w:<width>--specifies the width of the remote desktop screen.
· /h:<height>--specifies the height of the remote desktop screen.
· /console—if someone is connected and there are no more valid connections, this will connect to the console session.

For example, to remotely connect to a computer named pinky in a 640 x 480 remote desktop window, you would use the following command:
mstsc /v: pinky /w:640 /h:480

You can type this command line in the Start --> Run dialog box, as well as use it in a batch file.
(This will only work from XP pro and above)

2. Linux:

Resolving netbios name from an ip address
nmblookup –A <ipaddress>
e.g. nmblookup –A 192.168.170.39
will give the netbios name and group (domain) of the windows station with that ip address.