You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by b1g0af <ms...@vsync.com> on 2009/09/03 20:12:46 UTC

Need access to the Windows Shell

I'm running JMeter on a windows box, and I need access to the Windows Shell.
However, I don't see a way to do that. I've searched and searched for an
answer to no avail.

Really I need to send a Windows Custom Command to a windows service. If I
could get access to the windows command line, that'd solve the problem.
However, I see no way to submit a command (or series of commands) to the
windows shell. TIA!
-- 
View this message in context: http://www.nabble.com/Need-access-to-the-Windows-Shell-tp25281382p25281382.html
Sent from the JMeter - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Need access to the Windows Shell

Posted by Deepak Shetty <sh...@gmail.com>.
Just one caveat , Runtime.exec spawns a process and returns immediately. If
you need to wait till the process or .cmd has finished you'll have to put in
a delay or poll etc.
regards
deepak

On Thu, Sep 3, 2009 at 1:49 PM, b1g0af <ms...@vsync.com> wrote:

>
> With some fiddling, I was able to get it to work. For the record, I used
> the
> BSF Sampler with the Scripting Language set to "beanshell". In the Script
> To
> Run multi-line text box, I have:
>
> Runtime.getRuntime().exec("blah blah blah");
>
> Where blah blah blah is either the command you would normally type at a cmd
> window prompt, or it can be the path to a .bat file. Both seem to work
> fine.
> If you need to use backslashes, make sure you escape them (with a
> backslash).
>
>
> Deepak Shetty wrote:
> >
> > write a windows file (.wsc  or .cmd or whatever) , use a BSH/Java sampler
> > and use Java's Runtime.exec
> >
> > regards
> > deepak
> >
> > On Thu, Sep 3, 2009 at 11:12 AM, b1g0af <ms...@vsync.com> wrote:
> >> I'm running JMeter on a windows box, and I need access to the Windows
> >> Shell.
> >> However, I don't see a way to do that. I've searched and searched for an
> >> answer to no avail.
> >>
> >> Really I need to send a Windows Custom Command to a windows service. If
> I
> >> could get access to the windows command line, that'd solve the problem.
> >> However, I see no way to submit a command (or series of commands) to the
> >> windows shell. TIA!
> >
>
> --
> View this message in context:
> http://www.nabble.com/Need-access-to-the-Windows-Shell-tp25281382p25283856.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: Need access to the Windows Shell

Posted by sebb <se...@gmail.com>.
On 03/09/2009, b1g0af <ms...@vsync.com> wrote:
>
>  With some fiddling, I was able to get it to work. For the record, I used the
>  BSF Sampler with the Scripting Language set to "beanshell".

You could also have just used the BeanShell Sampler ...

>  In the Script To
>  Run multi-line text box, I have:
>
>  Runtime.getRuntime().exec("blah blah blah");
>
>  Where blah blah blah is either the command you would normally type at a cmd
>  window prompt, or it can be the path to a .bat file. Both seem to work fine.
>  If you need to use backslashes, make sure you escape them (with a
>  backslash).
>
>
>
>  Deepak Shetty wrote:
>  >
>  > write a windows file (.wsc  or .cmd or whatever) , use a BSH/Java sampler
>  > and use Java's Runtime.exec
>  >
>  > regards
>  > deepak
>  >
>  > On Thu, Sep 3, 2009 at 11:12 AM, b1g0af <ms...@vsync.com> wrote:
>  >> I'm running JMeter on a windows box, and I need access to the Windows
>  >> Shell.
>  >> However, I don't see a way to do that. I've searched and searched for an
>  >> answer to no avail.
>  >>
>  >> Really I need to send a Windows Custom Command to a windows service. If I
>  >> could get access to the windows command line, that'd solve the problem.
>  >> However, I see no way to submit a command (or series of commands) to the
>  >> windows shell. TIA!
>  >
>
>  --
>
> View this message in context: http://www.nabble.com/Need-access-to-the-Windows-Shell-tp25281382p25283856.html
>
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Need access to the Windows Shell

Posted by b1g0af <ms...@vsync.com>.
With some fiddling, I was able to get it to work. For the record, I used the
BSF Sampler with the Scripting Language set to "beanshell". In the Script To
Run multi-line text box, I have:

Runtime.getRuntime().exec("blah blah blah");

Where blah blah blah is either the command you would normally type at a cmd
window prompt, or it can be the path to a .bat file. Both seem to work fine.
If you need to use backslashes, make sure you escape them (with a
backslash).


Deepak Shetty wrote:
> 
> write a windows file (.wsc  or .cmd or whatever) , use a BSH/Java sampler
> and use Java's Runtime.exec
> 
> regards
> deepak
> 
> On Thu, Sep 3, 2009 at 11:12 AM, b1g0af <ms...@vsync.com> wrote:
>> I'm running JMeter on a windows box, and I need access to the Windows
>> Shell.
>> However, I don't see a way to do that. I've searched and searched for an
>> answer to no avail.
>>
>> Really I need to send a Windows Custom Command to a windows service. If I
>> could get access to the windows command line, that'd solve the problem.
>> However, I see no way to submit a command (or series of commands) to the
>> windows shell. TIA!
> 

-- 
View this message in context: http://www.nabble.com/Need-access-to-the-Windows-Shell-tp25281382p25283856.html
Sent from the JMeter - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Need access to the Windows Shell

Posted by Deepak Shetty <sh...@gmail.com>.
write a windows file (.wsc  or .cmd or whatever) , use a BSH/Java sampler
and use Java's Runtime.exec

regards
deepak

On Thu, Sep 3, 2009 at 11:12 AM, b1g0af <ms...@vsync.com> wrote:

>
> I'm running JMeter on a windows box, and I need access to the Windows
> Shell.
> However, I don't see a way to do that. I've searched and searched for an
> answer to no avail.
>
> Really I need to send a Windows Custom Command to a windows service. If I
> could get access to the windows command line, that'd solve the problem.
> However, I see no way to submit a command (or series of commands) to the
> windows shell. TIA!
> --
> View this message in context:
> http://www.nabble.com/Need-access-to-the-Windows-Shell-tp25281382p25281382.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>