Use the command line:

Rar.exe a -r -ep1 Test.rar "C:\Users\Desktop\abc"

Rar.exe is the console version of WinRAR stored in same directory as WinRAR.exe . You can use this command line also with WinRAR.exe if you want to see the compression process in a graphic window.

a is the command and means add files to archive.

-r is a switch to recursively add all files and subdirectories including empty subdirectories to the archive.

-ep1 is another switch which results in execluding base directory.

For this command line the base directory is "C:\Users\Desktop\" and therefore the created archive Test.rar contains only abc and all files and subdirectories in directory abc which is what you want.

One more hint: Using the command line

Rar.exe a -r -ep1 Test.rar "C:\Users\Desktop\abc\"

results in adding all files and subdirectories of directory abc to the archive, but without directory name abc being also stored in the archive. The backslash at end makes this difference.

In other words: On using switch -ep1 everything up to last backslash in file/directory specification is not added to the archive.

For more information about available switches see the text file Rar.txt in the program files directory of WinRAR.