If you want to execute a program on another server, you can use a stored procedure on that server to invoke the command, and call that stored procedure from the local mcahine.

You could also create a web service on the remote server that invoked the command you want to execute.

In either case, be very careful that you don't open a security hole by either allowing more users to execute commands through the mechanism you implement, or by some user to execute commands other than the one you intend.

execute a batch file on remote machine
I have used AjaxFileUpload to upload multiple image files. Now i want to store the uploaded images inside rootfolder>subfolder. 

The rootfolder is in the name of the user.
The rootfolder is created dynamically by taking the session of the user who has logged in 
Like this:  

string username = Session["username"].ToString();


I am able to create this folder and save images in it. but i want to save it in subfolder.

the subfolder is also created dynamically but this time i have to take the value(id) from the database and name the folder by that id name. (this is so that i can refer to the database)

I know how to create a new folder using Server.MapPath();
Here is the code for it in brief

using System.IO
if (Directory.Exists(Server.MapPath(uploadPath))) return;
else Directory.CreateDirectory(Server.MapPath(uploadPath));


where uploadPath is the folder's name i want to create dynamiclly.

but how do I include the subfolder too in my Server.MapPath() so as to make my path as rootfolder/subfolder ?

Small example to make the question understandable.
I am a seller. I have posted 4 ads online.
Now when i am posting my 5th ad i want to include many images. 
these images should be saved in the folder 

Seller/5/imagename.jpg. 
(where Seller is the username(main folder), 5 is the advertID in the database and the name of the subfolder)

How do i do this? Please help.
I am using asp.net c# 
