PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 06/13/2017 9:03 AM by  Kyle Jorgensen
Check If file directory exists, if does not exists create directory
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages
agersh
Systems Analyst
Martin Health System
Veteran Member
(143 points)
Veteran Member
Posts:73


Send Message:

--
06/09/2017 8:04 AM
    Using V10 IPA is it possible to check if a network directory exits? If the directory does not exist then create the directory on the network drive?
    David Williams
    Private
    Private
    Veteran Member
    (3061 points)
    Veteran Member
    Posts:1031


    Send Message:

    --
    06/09/2017 8:15 AM
    Using the Sys Cmd node

    You can get a list of network drives by using
    net use > mapped_drives.txt should dump a list of mapped drives to the text file mapped_drives.txt
    and then reading that file to search for your mapped drive.

    If not found, use
    net use z: \\remotepc\sharename
    To create the map

    It all depends upon your user access, of course

    https://superuser.com/questions/135752/list-mapped-network-drives-from-the-command-line-to-text-file
    https://www.windows-commandline.com/map-network-drive-command-line/
    David Williams
    agersh
    Systems Analyst
    Martin Health System
    Veteran Member
    (143 points)
    Veteran Member
    Posts:73


    Send Message:

    --
    06/09/2017 10:19 AM

    David, Thank you for the reply.

    I was hoping that I could have used possibly something like the File Access node to check if the subdirectory existed. And create the subdirectory if it did not exist.  

    Kyle Jorgensen
    Programmer/Analyst
    WoodmenLife
    Veteran Member
    (314 points)
    Veteran Member
    Posts:116


    Send Message:

    --
    06/13/2017 9:03 AM
    If you're not in the cloud, you can use a system command. For unix (korn shell) the command is:

     if [ -de /directory/path/]
      then
        do something
    fi 


    I'm not a windows person, but I would bet DOS offers something similar.
    You are not authorized to post a reply.