# Solved: Creating A Batch file to run Selenium RC



## patricklee (Jan 18, 2011)

I am running Windows 7 home premium

I have tried to create a batch file that should run Selenium RC but the path is coming up incorrect. 
The batch file is coded like this :And saved as a bat.

@echo off
START "c:\selenium\selenium-remote-control-1.0.3\selenium-server-1.0.3\java -jar selenium-server.jar"

The cmd opens up but I get this in the cmd windows

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Windows\system32>


----------



## TheOutcaste (Aug 8, 2007)

Try this:

```
START [COLOR=Red][B]""[/B][/COLOR] "c:\selenium\selenium-remote-control-1.0.3\selenium-server-1.0.3\java[COLOR=Red][B]"[/B][/COLOR] -jar selenium-server.jar
```
Windows often doesn't like having parameters inside the quotes, and Start sometimes sees the first thing in quotes as a title instead of the program, so the first two quotes take care of that.


----------



## gyclone (Jan 16, 2011)

The "@echo off" is suppressing any error messages that might give you more information about what is going on. I'd remove that, first, then see what messages you get in cmd.

Also, try typing your "START ..." command directly into a cmd, see if you get a different result there.

I don't know anything about Selenium, but I do know a little about batch files, so I might be able to help further.


----------



## patricklee (Jan 18, 2011)

Windows 7 Home Premium is my operating system 64 bit

1. I have created a new batch file with this line of code:

@echo on
START "" "c:\Selenium\selenium-remote-control-1.0.3\selenium-server-1.0.3\java" -jar selenium-server.jar

2. Dialog Box Error Message pops us that states:

Windows cannot find 'c:\Selenium\selenium-remote-control-1.0.3\selenium-server-1.0.3\java'. Make sure you typed the name correctly, and then try again 

3. The cmd command line is also launches at the same time and freezes: Its starts with this path:

C:\Windows\system32>START "" "c:\Selenium\selenium-remote-control-1.0.3\selenium-server-1.0.3\java" -jar selenium.jar

From what I can see: The path is starting at c:\windows\system32> and not the path I have specified in the batch file. Can you help me.


----------



## gyclone (Jan 16, 2011)

patricklee said:


> From what I can see: The path is starting at c:\windows\system32>


You can ignore the "c:\windows\system32>", cmd is not treating that as part of the file path.

Have you tried just typing your entire command into the command line, instead of running it from the batch file; if so does it work from there?


----------



## patricklee (Jan 18, 2011)

Yes I tried to type the same command from the batch file and i get the same results as running the batch file


----------



## patricklee (Jan 18, 2011)

I have check the spelling and I just pasted it into the cmd command line.


----------



## gyclone (Jan 16, 2011)

Try just typing:


```
START "" java -jar selenium-server.jar
```


----------



## patricklee (Jan 18, 2011)

The command (START "" java -jar selenium-server.jar) does launch the Selenium RC server when I am in the current (Path = c:\Selenium\selenium-remote-control-1.0.3\selenium-server-1.0.3>). If I am not in this path the command does nothing. I even tried typing the command at the Root of C:\ and nothing happens. So it works when I am in the directory (Selenium-server-1.03).


----------



## TheOutcaste (Aug 8, 2007)

Let's try using the */D* switch to specify the starting directory:

```
START "" /D "c:\selenium\selenium-remote-control-1.0.3\selenium-server-1.0.3" java -jar selenium-server.jar
```


----------



## patricklee (Jan 18, 2011)

That's it !!! Thank You very much. I have enjoyed learning from you. I will research the /D command also.


----------



## TheOutcaste (Aug 8, 2007)

You're Welcome!

Sorry for the typo, that should have been */D*, not */.D* (fixed now). Darn keys are too close together sometimes. At least it wasn't in the actual command line

Jerry


----------



## patricklee (Jan 18, 2011)

Thanks Jerry 

The code you sent was correct the first time. I really appreciate your help. The batch file is working correctly now. Thanks Again


----------



## Cookiegal (Aug 27, 2003)

patricklee,

You are reporting TheOutcaste's post rather than replying to it here.

The report button is only to report abuse or offensive posts.

Please use the reply button to reply here in the thread.


----------

