views:

336

answers:

3

I have a windows xp machine set up with Cygwin running the ssh service, on that machine I have a bat script that opens up IE using the following command "C:\Program Files\Internet Explorer\iexplore.exe" "http://windowsxpbox:3000/flex/flexUnitTests?debug=true#automated=true".

The script runs fine when I'm calling it locally on that xp machine, I am trying to call that same bat script remotely from another machine and achieve the same result but with IE opened on the remote machine, my problem is when the bat script is called remotely nothing happens on the remote machine.

A: 

aren't cygwin paths like /drive/c/....?

Blindy
Tried that, got the same problem with this path "/cygdrive/c/Program\ Files/Internet\ Explorer/IEXPLORE.EXE"
Chiwai Chan
A: 

Cygwin's shell doesn't know how to execute a batch script. Use cygwin to start cmd.exe, and let that run the batch file. E.G.

/cygdrive/c/Windows/System32/cmd.exe /c "c:\myscript.bat"

Edit: if you'd rather run explorer directly rather than relying on a batch file, the following works properly for me:

$ "/cygdrive/c/Program Files/Internet Explorer/iexplore.exe" "http://windowsxpbox:3000/flex/flexUnitTests?debug=true#automated=true"
Mark Ransom
thats not true, you can run batch scripts from the cygwin shell.
hhafez
I just tested it myself and got an error, although it wasn't the error I expected.
Mark Ransom
My problem is not so much as calling a bat script remotely, but the problem is starting up IE remotely.
Chiwai Chan
Cygwin is capable of running shell scripts, and some batch files might resemble shell scripts closely enough to run properly. If you're trying to do this explicitly, you should be aware of the differences and program accordingly.
Mark Ransom
I really do run batch scripts in cygwin, the startx comes in two flavours startx.sh and startx.bat and both are used to start up X
hhafez
+1  A: 

Just:

cygstart "http://www.google.com"

where google.com is your desired URL.

cygstart launches the default windows program for a path. So this way you get the user’s preferred web browser...

andrew
This in my opinion is the right answer.
Paul