[jcifs] How to execute perl file which is located in the server path using Jcifs?

Michael B Allen ioplex at gmail.com
Thu Jun 20 22:20:07 MDT 2013

On Mon, Jun 10, 2013 at 7:24 AM, mariaprabudass
<maria.prabudass at gmail.com> wrote:
> Hi,
> I need to *execute my Perl script file using Java
> Runtime.getRuntime().exec()*. But my perl script file *located in the server
> path*. I tried via *java SmbFile system*. But I found an Error. Kindly
> advise me, how to execute that perl script through *Java Jcifs* (Perl file
> located in the server path).
> *Example:-*
> SmbFile serverPath = new
> SmbFile("smb://domainName;userName:password@serverPath/");
> String ServerFilePath = serverPath + "test.pl";
> process = Runtime.getRuntime().exec("perl" + ServerFilePath);
> *Error:-*
> Can't open perl script
> "smb://TNQADYAR;3975:pearl_3975@":
> No such file or directory

HI mariaprabudass,

By default Java does not understand smb:// URLs. But if you install
the JCIFS smb:// URL handler with jcifs.Config.registerSmbURLHandler()
it might work. Not sure.


Michael B Allen
Java Active Directory Integration

More information about the jCIFS mailing list