This link tells you how to set Path.
http://java.sun.com/j2se/1.4/install-windows.html#Environment
Follow the instructions for NT/XP.
For Classpath, its the same basic steps except you will need to Add a new User variable if Classpath is not already defined. Be sure to add .; to the Classpath.
That said, you might not need to set the Classpath. Your post sounds like you can compile without any errors but you are getting an error when you try to run the program. If you post the exact error message, the exact command you entered, and the part of the source code that contains the class definition, we might be able to help you without messing with your environment.
For example, first time users often have the following troubles. (1) The argument to the java command is the Class Name, not a file name. If your class is called Hello then it is in a file named Hello.class and the command should be "java Hello" (2) Java class names are case sensitive - hello is different from Hello (3) Since . is the default classpath, you should CD to the directory that contains the file you are trying to execute.
In the message right above, do you put both of these statements in the autoexec.bat file like so?
set path=C:\jdk1.4\bin;%path%;
set classpath=c:\jdk1.4\jre\lib\rt.jar; c:\jdk1.4\lib\tools.jar;%classpath%;
If so, what is and does the %path%; and the %classpath% do at the end of these statements?