Alternate method of accessing iexplore.exe w/o STRPCCMD due to string length limitation

gmamoses used Ask the Experts™
Are there any other methods of calling iexplore.exe from the iSeries without using the STRPCCMD.  The string limitation (123 bytes) does not allow the sending of enough parameters.  The call looks something like this:

  '"C:\Program Files\Internet Explorer\IEXPLORE.EXE" HTTP://DEV:89/DEV/P13103/ CC_CNT_ENT.PHP?' +                        

I have posted this question on other iSeries websites and have received no response, please help and be as detailed as possible since I am new to this process.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
1) Create a file in IFS or QDLS containing the command as .BAT file. please note that the naming convention for this .BAT file should be similar to the PC naming convention.
2) Run this file from STRPCCMD.
Theo KouwenhovenApplication Consultant

If you are using Client Access, CA can do this for you.
change the setup of Client Access by menu:
Edit = Preferences = Hotspots =
Now check Execute URL and (if you like) 3-D Button.
and click Ok

Now if you show a HTML in an output field (not input) then you can click it.
you can try to edit a source file and add to it :
If you now view this source, this text is changed into a button or clickable link.
If the HTTP:.... text is to long, you can redirect it via your own webserver and put in the text on screen: or whatever



I really appreciate the responses; however,  I have a couple of questions

1) In the case of the response from Sriram, I probably did not make myself clear.  If I create a .BAT file in the IFS to house the command, how do I pass the parameters to the command.  They will change based on who the user is and the iSeries session the user is accessing from (multi-session) and the iSeries process the call is coming from.

2) In the case of Murphey, does your solution mean that every Client that tries to execute this command from a green screen has to have Client Access running on their machine.  Also, we have very limited space on the screens so there is not enough room to place a field large enough to hold the command, how would you suggest we handle this.

3) To both, please remember that I am a novice and it would be very beneficial to me if you could provide code demonstrating your solution, i.e. can I create the BAT file in the IFS on the fly?
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

create a shiortcut to Internext explorer in c:\

ie C:\ixp.lnk

you can then run the command as

STRPCCMD PCCMD('"C:\ixp.lnk HTTP://DEV:89/DEV/P13103/ CC_CNT_ENT.PHP?' +                        

which is with-in the limit

Theo KouwenhovenApplication Consultant

Hi gmamoses,

In the case of Sriram, you can write the .BAT file on the moment you need it, eventually you can give the .BAT file the name of the user-ID.BAT, then you dont need to create it per user, but the job will do when a user starts the program.
In case of the Clienat Access solution... yes every user needs CA on his/her computer.



Thanks daveslater and murphey2, I appreciate both of your comments

1) daveslater, you are correct about shortening the string in some fashion which will work for this project but when one of my associates or I have another project that requires a longer string we will be in the same situation.

2) murphey2, I have not tried your solution regarding the .BAT file but I would like to test it out.  I think since our users can have multiple sessions, I will have to name the BAT file based on the session id instead of the user id.  Can you tell me how to do this from an RPG program or a CL on the iSeries?  

First, if you go Start->Run on your Windows desktop, type [] for the command and press [enter], what result do you get?



In response to tliota I don't know what your point is.  I don't think your response is related to the question or I'm not understanding what your point is.
Theo KouwenhovenApplication Consultant

Hi gmamoses,

By typing in your run box, you can check if IE is somwhere in your path, in that case you simply can make a command like:
STRPCCMD PCCMD('HTTP://DEV:89/DEV/P13103/ CC_CNT_ENT.PHP?cmp=333&usr=xxxxxxxxxx&ssn=xxxxxxxxxx&ord=xxxxxxxxxx&cst=xxxxxxxxx''  

The .BAT version can be written as file and then copied with the CPY Command.
The CPY command requires a full path of your AS/400 file location e.g.

CPY OBJ('QSYS.LIB/MyLib.Lib/MyFile.File/MyMember.MBR')  


> I don't think your response is related to the question or I'm not understanding what your point is.

Murph has the basic idea in his comment.

I hope the rest this isn't too long, yet still gives you an idea of some of the possibilities.

When I type [] in the Start->Run input box on any Windows box that I have access to, Internet Explorer (or the default web browser) opens and processes the request.

For me, it wasn't necessary to type ["C:\Program Files\Internet Explorer\IEXPLORE.EXE"] as part of the input. Windows already knows what it's supposed to do with [http:xxxxxxxx]. The protocol is registered along with its handler. In general, that's also true of file extensions -- [c:\download\somedoc.txt] causes Notepad to start up and to open that .txt file.

By taking advantage of Windows capabilities, it becomes possible to significantly shorten the strings that you need to send. The problem changes slightly. Now, the problem becomes "What function do I need to invoke in order to get registered handlers to run?" By going through registered handlers, you automatically have your requests adapt to different configurations.

E.g., what if the C: drive isn't where a program is installed? A request for ["C:\Program Files\Internet Explorer\IEXPLORE.EXE"] would fail. By going through Windows services, the location and program are handled without needing to supply that part of the command string.

There are a few different ways to access Windows services. Rather than giving the path to IEEXPLORE.EXE, see what this does:

 == >  strpccmd  'start'

Run that from your AS/400 command line to see if it executes on your PC. The Windows START command has a bunch of command-line parameters that help with controlling its actions. You can open a Windows command window and type "help start" to get a basic introduction. You might also review "help cmd". Info on chaining commands together with "&&", redirection and all of the various command shell operators, might spark a bunch of thoughts on how to create a generic procedure to handle many kinds of future needs beyond this single specific one.

For example, you might review:

You might create a generic 'script' that you'd execute by running cscript and using a redirection or two to get different kinds of results. By chaining commands together, you could assign a mapped drive to a known IFS location that's shared and use that as the basis for your script. The mapped drive assignment might be the first in a series of chained commands. The script could read from a temporary file that you create somewhere else and execute its contents. You could put strings of essentially any length into your own streamfiles.

You find this useful:

The SET command might run in a script in order to construct an environment variable named "MyEnvVar". The final script command might then be [start %MyEnvVar%]. You could grab strings from lots of places to put togeyther into an environment variable. You could even have your script receive input from a temp file.

You might populate a temp file in the IFS by running some QSH utilities. The temp file might be in the current user's /home directory. You might create a mapped drive assignment on the current user's PC to point to the appropriate /home subdirectory.

Another area to examine might be RunDll32.exe as mentioned in:

That also touches on RUNRMTCMD, which gets around some limitations of STRPCCMD but requires much closer control on the PC side.

Some of my point is that you're looking at how to make Windows do something, but you're asking in an AS/400 topic area (and PHP). Perhaps asking the question in a Windows topic would get some extremely useful results.

I can get Windows to do a lot from our AS/400s, but I'm far from being a Windows expert.



tliotta, your message might be long but being a novice it is more in line with what I was looking for.  

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial