Windows Problems And Solutions

Syntax for creating batch files

 * CommandLine.co.uk - Batch File examples and Utilities

Uploading files using FTP

 * Create a batch file. Example upload.bat:

m: cd C:\Files\Project1\ ftp -i -s:ftp.txt www.mywebserver.com


 * Then create the file ftp.txt with the ftp commands:

username password cd public_html/myproject mput *.png *.html bye

Shutting Down

 * Many ways to shutdown different versions of Windows

Ping, Hosts, DNS
If you configured everything in the file, but you use the program  in one remote computer XXX and it does not work, but the  works for the computer yyy, try to flush your dns table and try again.

> ipconfig /flushdns

PsTools
Link: http://www.microsoft.com/technet/sysinternals/utilities/PsTools.mspx

The Windows NT and Windows 2000 Resource Kits come with a number of command line tools that help you administer your Windows NT/2K systems. Over time, I've grown a collection of similar tools, including some not included in the Resource Kits. What sets these tools apart is that they all allow you to manage remote systems as well as the local one. The first tool in the suite was PsList, a tool that lets you view detailed information about processes, and the suite is continually growing. The "Ps" prefix in PsList relates to the fact that the standard UNIX process listing command-line tool is named "ps", so I've adopted this prefix for all the tools in order to tie them together into a suite of tools named psTools.

Note: some anti-virus scanners report that one or more of the tools are infected with a "remote admin" virus. None of the psTools contain viruses, but they have been used by viruses, which is why they trigger virus notifications.

The tools included in the psTools suite, which are downloadable individually or as a package, are:


 * PsExec :execute processes remotely
 * PsFile :shows files opened remotely
 * PsGetSid :display the SID of a computer or a user
 * PsInfo :list information about a system
 * PsKill :kill processes by name or process ID
 * PsList :list detailed information about processes
 * PsLoggedOn :see who's logged on locally and via resource sharing (full source is included)
 * PsLogList :dump event log records
 * PsPasswd :changes account passwords
 * PsService :view and control services
 * PsShutdown :shuts down and optionally reboots a computer
 * PsSuspend :suspends processes
 * PsUptime :shows you how long a system has been running since its last reboot (PsUptime's functionality has been incorporated into PsInfo)

Speeding up the printer batch process
In order to increase the speed of the printer batch process for shared printers connected to the USB port of windows XP, you have to execute the following commands:

1) Connect the remote printer to a local port:

Syntax: NET USE lpt[number] \\networkshare\printer Example: NET USE lpt1 "\\vmserver\EPSON DX9400F"

2) Install the printer driver of the remote printer using the local port above.

3) Ready. It should increase the speed of the next printing.

Creating a batch file to show the IP address
Create a batch file called and type: ipconfig | find "IP" pause

This is useful for Windows XP and 2000. For Vista you can use "find IPv4".

How to identify listening or open ports
Use one of the following commands:

C:\WINDOWS>netstat -ano C:\WINDOWS>netstat -ano | find /i "listening" C:\WINDOWS>netstat -ano |find /i "established" Active Connections Proto Local Address Foreign Address State PID TCP  192.168.0.100:2496   212.179.4.7:80   ESTABLISHED   1536 TCP  0.0.0.0:445          0.0.0.0:0        LISTENING Then you can use the Task Manager to see which process has the PID above.

How to Configure Auto Logon
1) In the Start menu click Run and enter control userpasswords2.

2) Select the account you want to login automatically and uncheck ''Users must enter a user name and password to use this computer' checkbox. Click Ok.

3) Enter the password for the selected account.

Ready! From now on every time you start Windows it will automatically login.

How to change the Registered User
Execute the program and go to the following Registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion

There, you will find two keys that you can change the value: RegisteredOrganization and RegisteredOwner.

How to join splitted files
Suppose that you had file called norton.iso that was splitted in 4 files:

norton.iso.001 norton.iso.002 norton.iso.003 norton.iso.004

What you have to do is to execute the command below to join the file again:

S:\Extract>copy /b norton.iso.001 + norton.iso.002 + norton.iso.003 + norton.iso.004 S:\Extract>rename norton.iso.001 norton.iso

The files were merged with the first file. Therefore you have to rename the first file to the original file name.

How to add additional printer drivers
If you have a PC server using Windows 64 bits and you would like to share a printer connected to this server to clients that are using Windows 32 bits, you have to add additional printer drivers to the server 64 bits. Follow the instructions below:


 * 1) Open the printers window on the control panel of windows
 * 2) Click on the properties of your printer
 * 3) Select the tab Sharing
 * 4) Click on the button "Additional drivers..."
 * 5) Mark the checkbox titled x86
 * 6) Select the directory where the  files are. Normally use the installation CD of your printer that contains the printer drivers.
 * 7) Press ok

Ready! Now the 32 bits clients can connect and install the printer installed on the 64 bits server.

How to enable Windows Search Service
Normally, you have to start the index service, but under Windows Server 2008 the Windows Search Service is actually buried as a Role Service under the File Services Role.

These are the steps to add and enable the Windows Search Service in Windows Server 2008:

1) Start Server Manager.

2) Add the role File Services if it is not enabled.

3) Select Add Role Services in the Roles Summary pane to the right.

5) Select the Windows Search role service and click on "Install".

Finish the wizard and now you should have the Windows Search service up and running.

How to enable the Sleep or Hibernate function

 * Press the button "Start" and run the command to open the Local Group Policy Editor.
 * Open the node "Computer Configuration" -> "Administrative Templates" -> "System" -> "Power Management" -> "Button Settings"
 * Double-click on the property "Select the Sleep Button Action".
 * Select "Enabled" and the action for the sleep button of your keyboard. Here you can select if you want enable the sleep or hibernate function.