Execute batch on a remote server

Execute batch on a remote server

I'm developing a Outsystems application and I need to run a batch file on a remote server . The file I want to run is in the remote server (in a folder that is shared with everyone who access the server) and I need to be able to run the file through an action in the application I'm developing but I don't know how to run files that are located on remote servers. 
This remote server do not have the Outsystems Platform installed and I need a solution that allows me to specify the domain, user, pass and hostname of the remote server.
Anyone has any solution?
Thank you in advance,
Vânia Calado
Hi Vânia,

You might want to try the following:
1. Map your remote server folder as a network drive in the OutSystems Platform server;
2. Use extension Process to run your batch file from the command line, from your OutSystems Platform application.

You might also want to take a look at Network FileSystem extension, which provides directory and file browsing/management capabilities, though not execution.

Hope this helped. Let me know if this fit your needs.

Thanks for the reply, but in this case the remote server and the location of the folder where the batch file is saved is dynamic, this information is defined by the user in the Outsystems application so we can not set the folder on the remote server as a network driver.
I need a way to execute the file on the server taking into account the information available on the OutSystems application (user, pass, hostname, domain ...). We use the network file system to verify that the file exists and to save the information, but through the network file extension we can not execute the file.

Vânia Calado
Could perhaps a custom (web?) application be available in the remote server? Would you be able to setup say, a web service that could be called (very easily) from the OutSystems Platform?
Hi Pedro,

I'm working in the same project as Vânia, so let me try to explain this with more detail:

Our Outsystems application has a page with a form where you insert:
- Hostname/IP
- Domain
- User
- Pass
- Path
- Batch FileName

This data will be registered on Outsystems Database, so this is Dynamic.

With Network File System Extension, we can reach the file to verify if it exists, but we can't execute it because its libraries doesn't have that capabilities.

The remote servers Administrator only need to give permissions to Outsystems user on that specific folder, and we will not ever have permissions to go to this remote servers, so it is not possible to create anything there. In fact, we won't know any information about wich remotes will exist.

At Google, we found something about PsExec but I think its necessary to install something on server.

Any help is a start :)

Thanks in advance,

Nelson Freitas
Hi Nelson,

I'm afraid I haven't had any similar experience as yours. But upon closer look, this ASP.NET Forum topic might put you on track. They used precisely the same Process extension .NET classes in order to execute batch files in a remote machine. Let me know if this helped, please.
...also, please take a look at this tool - PsExec. I really like SysInternals products! Maybe this client executable can make that magic you need.