[THIN] Re: Launching apps via .cmd files

  • From: "Evan Mann" <emann@xxxxxxxxxxxxxxxxxxxxx>
  • To: <thin@xxxxxxxxxxxxx>
  • Date: Thu, 5 Jan 2006 09:58:10 -0500

Thank's for the explanation.  I'm still having a problem getting the
application to run.  I simply did start d:\datatrac\runtrac.exe but
nothing is running. 

I published the .cmd directly (not through ctxhide) with start in the
.cmd file and the app launched OK.

Something doesn't want to work when pushed through ctxhide.exe.  

I'm doing this via WI.  I see the client connect, login scripts run,
checking for newer client, then 1 think it flips through I can't read
fast enough, and then I end up logged into the server, with no apps
running.  The only processes for my user running are ctfmon.exe,
wfshell.exe, userinit.user, ssonvr.exe, 

-----Original Message-----
From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] On
Behalf Of Jim Kenzig http://ThinHelp.com
Sent: Thursday, January 05, 2006 9:38 AM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: Launching apps via .cmd files

When you use ctxhide it hides the script and anything within it.  Using
the start command within the script to launch the executable opens the
executable in a new window.  It is a good practice to get into when
publishish any batch file within Citrix whether you are hiding it or not
so that the the cmd window closes properly and is not left stuck open.
It also gives you some powerful command line switches to start the
program how you want it to run.
 
Here is the info on start:
 
Starts a separate window to run a specified program or command.
START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOW
      [/WAIT] [/B] [command/program]
      [parameters]
    "title"     Title to display in  window title bar.
    path        Starting directory
    B           Start application without creating a new window.
                application has ^C handling ignored. Unless the a
                enables ^C processing, ^Break is the only way to
                the application
    I           The new environment will be the original environm
                to the cmd.exe and not the current environment.
    MIN         Start window minimized
    MAX         Start window maximized
    SEPARATE    Start 16-bit Windows program in separate memory s
    SHARED      Start 16-bit Windows program in shared memory spa
    LOW         Start application in the IDLE priority class
    NORMAL      Start application in the NORMAL priority class
    HIGH        Start application in the HIGH priority class
    REALTIME    Start application in the REALTIME priority class
    ABOVENORMAL Start application in the ABOVENORMAL priority cla
    BELOWNORMAL Start application in the BELOWNORMAL priority cla
    WAIT        Start application and wait for it to terminate
    command/program
                If it is an internal cmd command or a batch file
                the command processor is run with the /K switch t
                This means that the window will remain after the
                has been run.
                If it is not an internal cmd command or batch fil
                it is a program and will run as either a windowed
                or a console application.
    parameters  These are the parameters passed to the command/pr

If Command Extensions are enabled, external command invocation through
the command line or the START command changes as follows:
non-executable files may be invoked through their file associatio
    by typing the name of the file as a command.  (e.g.  WORD.DOC
    launch the application associated with the .DOC file extensio
    See the ASSOC and FTYPE commands for how to create these
    associations from within a command script.
When executing an application that is a 32-bit GUI application, C
    does not wait for the application to terminate before returni
    the command prompt.  This new behavior does NOT occur if exec
    within a command script.
When executing a command line whose first token is the string "CM
    without an extension or path qualifier, then "CMD" is replace
    the value of the COMSPEC variable.  This prevents picking up
    from the current directory.
When executing a command line whose first token does NOT contain
    extension, then CMD.EXE uses the value of the PATHEXT
    environment variable to determine which extensions to look fo
    and in what order.  The default value for the PATHEXT variabl
    is:
        .COM;.EXE;.BAT;.CMD
    Notice the syntax is the same as the PATH variable, with
    semicolons separating the different elements.
When searching for an executable, if there is no match on any ext then
looks to see if the name matches a directory name.  If it do START
command launches the Explorer on that path.  If done from t command
line, it is the equivalent to doing a CD /D to that path.
 
 
Jim Kenzig


----- Original Message ----
From: Evan Mann <emann@xxxxxxxxxxxxxxxxxxxxx>
To: thin@xxxxxxxxxxxxx
Sent: Thursday, January 05, 2006 9:27:24 AM
Subject: [THIN] Re: Launching apps via .cmd files


Is this a requirement only when you use ctxhide.exe?   I didn't have
start specified before using ctxhide and the application launched ok.

Should I use start in all .cmd files with published apps, even if I'm
not passing them through ctxhide.exe ?


-----Original Message-----
From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] On
Behalf Of Jim Kenzig http://ThinHelp.com
Sent: Thursday, January 05, 2006 9:09 AM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: Launching apps via .cmd files

You need to use the start command to run your executable in your script
start r:\datatrac\runtrac.exe

JK

----- Original Message ----
From: Evan Mann <emann@xxxxxxxxxxxxxxxxxxxxx>
To: thin@xxxxxxxxxxxxx
Sent: Thursday, January 05, 2006 8:58:45 AM
Subject: [THIN] Re: Launching apps via .cmd files


That looks like the winner.  But for some reason the program won't
launch now. It ran fine with just the .cmd directly published.  This is
what I published:

"c:\program files\citrix\System32\ctxhide.exe"
d:\customizations\run_datatrac.cmd

Contents of the .cmd

@ECHO OFF
net use r: /delete
net use r: \\corp-storage\vol1
r:
cd datatrac
r:\datatrac\runtrac.exe


-----Original Message-----
From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] On
Behalf Of Carl Stalhood
Sent: Wednesday, January 04, 2006 10:45 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: Launching apps via .cmd files

Or you can publish c:\program files\citrix\system32\ctxhide.exe and pass
it the path of the .cmd file. This is how usrlogon.cmd is hidden.

-----Original Message-----
From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] On
Behalf Of Tim Mangan
Sent: Wednesday, January 04, 2006 9:14 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: Launching apps via .cmd files

The trick is in how you execute the cmd.exe string, not what's inside.
I think it's "cmd.exe /c file.cmd".  

-----Original Message-----
From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] On
Behalf Of Evan Mann
Sent: Wednesday, January 04, 2006 9:56 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Launching apps via .cmd files

I'm doing some testing with launching a network app via a .cmd file,
instead of directly publishing the app.  So far, things seem OK, but I
was wondering if there is any way to complete hide the command prompt
window so the user doesn't see it.

I published an app that runs d:\run_program.cmd and I specified @ECHO
OFF in the .cmd file.  So when the app runs, the cmd prompt box shows
up, and they see some text related to network drives being disconnected
and reconnected, then the app launches and the cmd box goes away. I'd
like to make the entire process silent until the actual app launches. 
************************************************
For Archives, RSS, to Unsubscribe, Subscribe or set Digest or Vacation
mode use the below link:
//www.freelists.org/list/thin
************************************************
************************************************
For Archives, RSS, to Unsubscribe, Subscribe or
set Digest or Vacation mode use the below link:
//www.freelists.org/list/thin
************************************************

Other related posts: