Hitachi Vantara Pentaho Community Forums
Results 1 to 9 of 9

Thread: UNC path on a shell script component

  1. #1
    Join Date
    May 2014
    Posts
    5

    Default UNC path on a shell script component

    Hello,

    Im' trying to execute a .bat file using shell script component, it's working fine but I have a problem when I want to use an UNC path instead of a "classic" path.

    Example :

    f:\folder\program.bat ----> this is working
    \\networkpath\f\folder\program.bat ----> this is not working

    It's executed on a Windows 7 os, using 4.3.0-stable version of PDI.

    Any idea of why ?

    Thanks !

  2. #2
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    Have you tried to execute the batch outside of PDI?
    Does it work?
    -- Mick --

  3. #3
    Join Date
    May 2014
    Posts
    5

    Default

    Hello,

    Yes, I tried and it worked.
    I think my problem is only linked to the UNC path, when I'm using the "classic" way, no problem, but as soon as I put an UNC path instead, no program is found by PDI. It's like it could not resolve the UNC path

  4. #4
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    Could it be related to user permission across the network?
    I know that if you can run a batch using a shortcut it "should" work even using the UNC name, but it's not always like that.

    It has occurred few times that copying files (with a batch process) across the network, if using a UNC that process failed, while using a mapped drive it worked fine.
    My guess was that it's a network issue - the server was "losing" contact with the destination machine for a short time, enough to cause the copy process to fail.
    -- Mick --

  5. #5
    Join Date
    May 2014
    Posts
    5

    Default

    Mick,

    I understand what you are saying but I think you misunderstood my problem, it's not on my .bat program that I'm trying to use UNC paths, I'm doing something totally different, no files or paths problem on the .bat itself .

    It's on the kettle "execute shell script" component in the textbox for "script file name" that I'm trying to use an UNC path.

    When I'm using a classic mapping ( a letter for the disk ) like f:\folder\program.bat, component is working fine, but if I'm trying to use this \\networkpath\f\folder\program.bat, it's failing.

  6. #6
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    Oh, I understand now!
    Have you browsed to the batch file or have you written the path yourself?
    But are you running a batch file which reside on a different machine then PDI? It seems an odd choice to me.
    Why not copy the batch file on the machine running PDI?
    -- Mick --

  7. #7
    Join Date
    May 2014
    Posts
    5

    Default

    Yes, I know it's strange but I can't move this .bat on the same machine than PDI, so I need to find a way to execute it from its network place ( I can't do anything about this :s ).

    Why I'm trying to use UNC, i can explain, originally, I mapped with a classic method, so with that f:\folder\program.bat, but my process is running on a server every night ( by windows task planification ),and here is the problem :

    When the process launch on the night, there is no session open on the server, so it's not working because "f:" doesn't really exist ( you need an open session to allow the gpo to map with letters ), so, i think, ok, no problem, I will take UNC path to allow the process to understand where is the information, instead of using the classic letter. that's why I'm trying to use that, so, yes i wrote the path by myself, tested differents ways like "file:///hostname/f/folder/program.bat" for example.
    What is totally crazy is that a path like above is working fine with another pdi component ( files copy component ) but not for the shell script...

  8. #8
    Join Date
    May 2014
    Posts
    5

    Default

    I didn't found any solution but I know why it's not working now.
    When shell script component is launched, java is interpreting it, also the textbox for "script file name", so when i'm writing something like that \\networkpath\f\folder\program.bat on the textbox , Java transform it on something like that file:////networkpath/f/folder/program.bat.
    But the problem is that the shell script execution on my Windows platform is launching with cmd.exe, and Windows is not ok with a path like file:////networkpath/f/folder/program.bat, so it's not working...
    And I didn't find any way to keep my "real" path like \\networkpath\f\folder\program.bat, Java is still re-interpreting the path...

  9. #9
    Join Date
    Apr 2008
    Posts
    4,683

    Default

    From what I recall, UNC path is not officially supported in PDI.
    It will sometimes work, and others it won't.

    Basically same as what you were saying: It gets converted to a URI, and in some places, that's allowed, in others it is not.
    What you can do in your scheduled batch file (the one that calls PDI) you can put a couple of extra statements:

    Code:
    REM The following line maps f: to \\Networkpath\f as somelimiteduser.  WARNING: Password in plaintext!
    net use f: \\networkpath\f password /USER:somelimiteduser
    Your PDI call goes here...
    REM The following line unmaps f:
    net use f: /DELETE
    **THIS IS A SIGNATURE - IT GETS POSTED ON (ALMOST) EVERY POST**
    I'm no expert.
    Take my comments at your own risk.

    PDI user since PDI 3.1
    PDI on Windows 7 & Linux

    Please keep in mind (and this may not apply to this thread):
    No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.
    Signature Updated: 2014-06-30

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.