Wednesday, September 24, 2014

How to map an IFS folder as a Windows share folder

Map an IBM i AS400 IFS folder to a Windows share folder

After reading the post Easy way to convert CSV file to DDS file Martin Coates emailed me with the following question:

How do you map a folder in the IFS and share is on the pc? I am an As400 “purist” but more and more I find programming requests overflowing into the pc domain.

In this post I will discuss how to create a folder in the IFS, and then how to share it as a folder that can be accessed by a Windows PC. If you already know how to create folders in the IFS feel free to skip to the second part.

How to create a folder in the IFS

I can create folders using either the Operations Navigator or the browser based IBM Navigator for i.

In this example I am going to create folder called simonh, which is a subfolder within the folder users. In other words the path for the folder will be:

  \users\simonh

Note:  You can click on any of the images below to see a bigger version of them.

Creating a folder using the Operations Navigator

I open the Operations Navigator, and I select the IBM i I want to create the folder on.

I click on the + (plus sign) next to File Systems.

Then I click on the + next to Integrated File System.

I riight click on the Root, and select New Folder.

In the pop-up windows, shown on the right, I am going to enter:

  • New folder name: /user/simon
  • Audit objects created in folder: None. I use "None" as I do not want to cause an audit entry to be sent to the auditing journal whenever this folder is used.
  • Scan objects created in folder: No. I do not want any files created in this folder to be scanned by the scan-releated exit program.
  • Restrict rename and unlink: Unchecked.

When I have entered and changed what I want I click on the OK button and the subfolder simonh is created in the users folder.


Creating a folder using the IBM Navigator for i

If you have never used this read: Navigate your IBM i using a web browser.

I log into the IBM Navigator for i for the IBM i I want to create the folder on.

In the menu on the right I find Files Systems and click on the + next to it.

Under the Integrated File Systems heading I click on the Create Integrated File System Folder link, see above.

I do not enter the path name here, above, I click on the Browse button. I have found it is easier to select the folder, users, and add the subfolder there.

When I have found the users folder I click on it. Then I click on the add icon, circled in red, to create my subfolder, see above.

I enter the subfolder name in the Folder Name box, see above, and click the OK button.

And the subfolder is created, see above.

 

How to share the IFS folder

Having created the subfolder simonh I need to share it. This will make it available to my Windows PC.

Sharing using Operations Navigator

I find the folder users, and click on the + next to it to see the subfolder simonh. I right click on simonh and select Sharing, see below.

I enter a share name, SimonH, and changed the access to Read/Write.

Finally I click the OK button and I am done.

Sharing using IBM Navigator for i

In the menu on the right I find File Systems and click on the + next to it, and then I click on the Create File Share link, see below.

I enter a share name, SimonH, changed the access to Read/Write, and in the Path Name I enter the path /users/simonh, see below.

When I am done I click the OK button.

 

How to map the folder to the Windows PC

Now to map the IFS folder I can do it one of two ways:

  1. Manually map a drive to IFS folder using Windows Explorer
  2. Using a batch file (program) to map a drive to IFS folder

When I map to an IFS folder I only do so when I need to as there is no point in wasting time when booting up my Windows PC to map the drive to the IFS folder that I might not use today.

Manually map a drive to IFS folder using Windows Explorer

I am sure many of you already have drives mapped to folders on various servers and this is no different. In the Windows Explorer I click on Tools on the menu bar and select Map network drive.

The dialog box above is displayed. I choose a drive letter that is not being used.

For the Folder I enter the path to the IFS folder. Which would be:
\\my-ibmi\users\simonh
I would, of course, replace my-ibmi with the name of my IBM i.

As I said above I always make sure that the Reconnect at logon is unchecked.

My Windows login and IBM i signon and passwords are different so I check the Connect using different credentials.

Then I click on the Finish button, and the Enter Network Password dialog appears, see below.

This is where I enter my IBM i user name and password. I never check the Remember my credentials. When finished I click the OK button.

Voila! I now have a Z: drive which is mapped to my IFS folder.

Using a batch file (program) to map drive to IFS folder

Rather than perform this mapping manually every time I want to use the folder I will create a batch file (program) to do the same thing. It would look like:

  @cls
  net use Z: \\my-ibmi\users\simonh
  pause

I would replace my-ibmi with the name of my IBM i.

Hey presto! I now have drive Z: mapped to my IFS folder.

So why do I use the pause in the batch file? If there is a problem with connecting to the IBM i or mapping to the IFS folder I will see the message. If it is missing the batch file will complete and I will be none the wiser to why I am not mapped to Z:

 

This article was written for IBM i 7.1, and it should work with earlier releases too.

7 comments:

  1. I've done this many times. The gotcha at times if is your network people employ a network naming convention that is static that is not ISeries compatible. For example: Your network login is JSmith01 but when mapping, the login is fixed as ab\JSmith01 and can'tb e changed no matter what, even using a different ID.
    That's the case where I'm at now.

    ReplyDelete
  2. Problem resolved. I went to "my computer" and looked at the drives that were mapped by firm. Their root is abcde\JSmith01. When I use that to connect to the IFS mapped drive, it works perfectly. What is shown is "root on systema '12.23.45.67" (example) but you get the idea.

    ReplyDelete
  3. I permanently map drives to the IFS - to speed the "boot-up" process qualify your system "i" UserId with your server name - allows Windows to immediately access the correct credientials from the correct box.
    Example User Name: system_i\j_smith
    Another tip use Windows Credential Manager on the Control Panel to maintain your passwords for your mapped IFS Folders

    ReplyDelete
  4. What timing, we were just talking today in the office about how to share excel file between i5 and the network drive (windows PC).

    ReplyDelete
  5. Randall, there's a method to do this using Excel fille add-ins for IBM i. For Excel 2003, 2007, 2010 there's 1 method of implementation, for Excel 2013 a diff way. Same result from both.
    I can be reached at LinkedIn if you want more info. Contact me if you'd like.

    ReplyDelete
  6. Should you not also set the IFS properties to enable file extension o be eligible for automatic text conversion?

    ReplyDelete

To prevent "comment spam" all comments are moderated.
Learn about this website's comments policy here.

Some people have reported that they cannot post a comment using certain computers and browsers. If this is you feel free to use the Contact Form to send me the comment and I will post it for you, please include the title of the post so I know which one to post the comment to.