On Wed, 31 Jul 2002 15:44:43 -0400, Jerry Johnson wrote:
> OK, is that runme.exe a compiled perl script?
Yes it is but I have the source and compiler so modifcations will be a snap.
> It looks like you are already passing a couple of parameters. If so, we just need to
>add the new variable to the end, and find the variable in perl in the 3rd slot:
> $USER=$ARGV[2];
> $ENV("USER")=$USER
>
Thanks Jerry...I'll give it a shot.
> (I hope)
> Jerry Johnson
>
> >>> [EMAIL PROTECTED] 07/31/02 03:15PM >>>
> On Wed, 31 Jul 2002 15:25:42 -0400, Jerry Johnson wrote:
>
> > Rambling, yes, but I think I get it.
> >
> > Does this sound about right?
> >
> > You know the USER info in CF. (cgi.remote_user)
> > CF calls a static BAT file
> > the static BAT file calls a perl script
> > the perl script needs the USER info.
> >
>
> Wha hoo!!!! YES!!
>
> > So, you need to pass a variable from CF to perl, through the bat file then through
>the perl call.
>
> Correct.
>
> > Do you call the bat file from CF using cfexcute?
>
> Exactly.
>
> > You need to pass the user info to the bat file on the command line.
> > You need to grab that info in the bat and pass it to perl
> > you need to grab it from perl and use it.
> >
> > change the call to execute the bat file to include a space, and then the username
>(or whatever var you want to pass)
> > <CFX_SHELLEXEC FILE="runbat.bat JERRY" DIRECTORY="c:\">
> > change the call to perl in the bat file
> > perl f:\articles\admin\fax.pl $1
> > change the perl file to read the first arg passed to it
> > $USER=$ARGV[0];
> > $ENV("USER")=$USER
> >
> > (NOTE: the passing of parameters to the bat file changes based on what CF function
>you use to call it. Check the docs for the tag you are using)
>
> I see but my perl script has two other arguments passed to it.
>
>
> Example:
>
> <program> <input-file> <printer-destination>
>
>
> Here is the contents of my batch file which I'm executing via <CFEXECUTE
>
> setlocal
> d:
> cd d:\dir\form
> c:\programs\utilities\runme.exe d:\test\testfile printer
>
>
>
>
>
>
>
> > Jerry
> >
> > >>> [EMAIL PROTECTED] 07/31/02 02:49PM >>>
> > I think I should explain my problem a little better.
> >
> > Currently we connect to our server via a telnet session. Users execute a perl
>script that in turn executes another program that outputs printed pages. All these
>pages has the
> > users (login) name at the top which is being picked up by the following lines in
>the perl script
> >
> > $USER=$USERNAME
> > $ENV("USER")=$USER
> >
> > I have a web interface which the user accesses by entering in their
>username/password via NT authentication. When I execute my batch file via the web
>interface the
> > username variable does not get printed in the page. All my batch file is doing is
>executing the same command as if it was done from a telnet prompt. Somehow I need to
>get
> the
> > username (from the NT authentication???) passed to my perl script?
> >
> > I think I'm just rambling. I don't think I'm explaining this properly...
> >
> >
> >
> > On Wed, 31 Jul 2002 14:51:31 -0400, Jerry Johnson wrote:
> >
> > > Yes.
> > >
> > > In a bat file I run, I pass in the directory to use:
> > >
> > > perl f:\articles\admin\fax.pl f:\\articles\\ma\\02\\convert
> > >
> > > Then in the perl file, I grab the first argument passed in
> > >
> > > $sgmldir=$ARGV[0];
> > >
> > > Does this help?
> > > Jerry Johnson
> > >
> > >
> > > >>> [EMAIL PROTECTED] 07/31/02 02:24PM >>>
> > > Hello,
> > >
> > > Is there a way to pass a variable to a perl script using CF?
> > >
> > > I need to pass the username which I dump into a variable when the user logs in
>via NT authentication to my perl script. This script is being run via a web interface
>which
> > executes a
> > > bat file on the server. I the batch file I change directories and execute my
>perl script.
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>
______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists