This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How do I start two commands in .bat ?


Did you follow up on the original "hint" ("help start")?  If you did, you
would have come up with:

	@echo off
	chdir C:\cygwin\bin
	start "C:\Program Files\realvnc\vncviewer.exe"
	bash --login -i -c "ssh -L 5901:derqjzp:5900 -C isoft@derqjzp"

As for backgrounding the program in bash, you should do it *before* you
start ssh:

	@echo off
	chdir C:\cygwin\bin
	bash --login -i -c "(/cygdrive/c/program\ files/realvnc/vncviewer.exe" &); ssh -L 5901:derqjzp:5900 -C isoft@derqjzp"

Either of the above should work.

For the future: the cygwin at cygwin dot com is really the only cygwin
list even remotely appropriate for this kind of query.  Also, if you start
a thread on a mailing list, it's usually a good idea to continue that
thread to its logical conclusion, as well as make sure the final solution
is in the list archives (it will be in this case).
	Igor

On Tue, 14 Jan 2003, a12 wrote:

> Daniel,
>
> vnc server is run on derqjzp
>
> C:
> chdir C:\cygwin\bin
> bash --login -i -c "ssh -L 5901:derqjzp:5900 -C isoft@derqjzp
> /cygdrive/c/progra~1/realvnc/vncviewer.exe"
>
> requests isoft's password, and start ssh
>
> C:
> chdir C:\cygwin\bin
> bash --login -i -c "ssh -L 5901:derqjzp:5900 -C isoft@derqjzp ;
> /cygdrive/c/progra~1/realvnc/vncviewer.exe"
>
> requests isoft's password, and shuts down the cygwin window.
>
> Any more hints ?
>
> Daniel Bößwetter wrote:
>
> > Which machine is vnc supposed to run on? localhost or derqjzp?
> >
> > In the former case, you's say
> >
> > bash -c "ssh isoft@derqjzp ; vncviewer"
> >
> > in the latter case
> >
> > bash -c "ssh isoft@derqjzp vncviewer"
> >
> > What you wrote (below) looks like you tried to start vncviewer from the
> > .bat-file. This line is never reached, because bash never returns
> > (unless you terminate ssh and even then it wouldn'r work, because it's a
> > cygwin virtual path).
> >
> > Hope it helps.
> > Daniel
> >
> > a12 wrote:
> >
> > >Hello gurus,
> > >
> > >In my ongoing process of starting ssh and vncviewer in one .bat
> > >file, I have created the following:
> > >
> > >rem @echo off
> > >chdir C:\cygwin\bin
> > >bash --login -i -c "ssh -L 5901:derqjzp:5900 -C isoft@derqjzp"
> > >"/cygdrive/c/program files/realvnc/vncviewer.exe" &
> > >
> > >I enter the isoft's password, and ssh is started.
> > >vncviewer is not started.
> > >How do I make vncviewer started ?

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]