cancel
Showing results for 
Search instead for 
Did you mean: 

Run a bat file on remote windows server from web dynpro java

Former Member
0 Kudos

Hi, I have a requirement where I need to run a window .bat file located on a windows server on the intranet from a web dynpro java application running on SAP Portal.

SAP Portal is running on Unix.

Thanks.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Jun and Govardan, but the limitation here is that we do not have JRE on the windows server machine. Do we have any third pary API through which we can directly execute the file on the windows machine ?

junwu
Active Contributor
0 Kudos

it won't be that easy, just a api call

Former Member
0 Kudos

Have you any SAP software installed on that server? Is it a problem to install JRE on that server? In any case you can write your program as WS on any native language (like C).

govardan_raj
Contributor
0 Kudos

Hi Aditya,

go throught this link

http://stackoverflow.com/questions/12615475/basics-reading-writing-remote-files-using-java

and then go through this for executing the batch file

http://bytes.com/topic/java/answers/706237-execute-bat-file-java

you can use java code to execute .bat file , but here in your case you have to execute that remotely for that purpose read the first link and make necessary settings

then go throught the second link which shows an example of executing batch file from java, and you can google for java code for  executing .batch file , many helpfull links are available.

Regards

Govardan Raj

junwu
Active Contributor
0 Kudos

nothing to do with sap....

just use your imagination or google....

create a java program to execute the bat and expose it as ws,which can be called in your portal java code