Hi, 
 
Sorry, I'm a stupid guy ! Of course a batch file doesn't know %p ... 
 
Thanks Dirk for your sample and Oliver. 
 
 ----- Original Message ----- 
From: Oliver Hierlein (mailto:hierl...@rzh-nds.de) 
To: Servers Alive Discussion List (mailto:salive@woodstone.nu) 
Sent: Tuesday, March 23, 2010 12:30 PM 
Subject: RE: [SA-list] Questions about ServersAlive and passing variable in a 
batch file 


Hi, Patrice. 
 
Two things: 
 
- Put quotation marks around %p when you call the batch, eg. mybatch.bat "%p" 
  This is necessary in case there is a blank in the value of %p. Otherwise only 
the first part of that value will be taken. 
 
- Within the batch, do not use %p but %1, as it is the first Parameter that is 
passed to the batch file that you want to use. 
  Within the batch file, %p is unknown. So it is correctly delivering an empty 
string as an result. 
 
Cheers 
Oliver -----Original Message-----
From: PatriceH [mailto:phermi...@gecip.fr]
Sent: Tuesday, March 23, 2010 12:10 PM
To: Servers Alive Discussion List
Subject: Re: [SA-list] Questions about ServersAlive and passing variable in a 
batch file


hello Dirk, 
 
Thanks for your answer. 
 
It seems not working for me. May be I put the wrong entries in my batch file. 
For testing, I created this batch file and passed the variable %p. 
 
Command line in Alert Tab : mybatch.bat %p 
 
Mybatch.bat : 
Echo on 
set name = %p 
Echo "%name%" 
 
The result : 
"" 
 
May be I misunderstood something. Could you give me an example ? 
 
Sincerely, 
 
Patrice. 
 
 ----- Original Message ----- 
From: Dirk Bulinckx (mailto:d...@woodstone.nu) 
To: Servers Alive Discussion List (mailto:salive@woodstone.nu) 
Sent: Monday, March 22, 2010 5:00 PM 
Subject: RE: [SA-list] Questions about ServersAlive and passing variable in a 
batch file 




When the BAT file is called you can within it's commandline add all of the % 
parameters. 

Do know that the "result" of the % paramters can contain a SPACE so make sure 
your BAT file can handle them. 

 

 

dirk 

 

From: Servers Alive Discussion List [mailto:sal...@woodstone.nu] On Behalf Of 
PatriceH
Sent: Monday, March 22, 2010 4:25 PM
To: Servers Alive Discussion List
Subject: [SA-list] Questions about ServersAlive and passing variable in a batch 
file 

 

Hello, 


 


I chose the "Execute command" in the Alert Tab. I execute a batch file to send 
SMS. I would like to pass SA variables (%p, %s, ...) to my batch file. 


 


For example : 


 


Echo on 


Set Pretty_name = %p 


Set Status = %s 


 


Echo The status of %p is %s. 


 


Thanks for yours ideas. 


 


Sincerely. 


 


Patrice. 



To unsubscribe send a message with UNSUBSCRIBE in the subject line to 
salive@woodstone.nu
If you use auto-responders (like out-of-the-office messages), make sure that 
they are not sent to the list nor to individual members. Doing so will cause 
you to be automatically removed from the list.

To unsubscribe send a message with UNSUBSCRIBE in the subject line to 
salive@woodstone.nu
If you use auto-responders (like out-of-the-office messages), make sure that 
they are not sent to the list nor to individual members. Doing so will cause 
you to be automatically removed from the list. 

To unsubscribe send a message with UNSUBSCRIBE in the subject line to 
salive@woodstone.nu
If you use auto-responders (like out-of-the-office messages), make sure that 
they are not sent to the list nor to individual members. Doing so will cause 
you to be automatically removed from the list.

- 

To unsubscribe send a message with UNSUBSCRIBE in the subject line to 
salive@woodstone.nu
If you use auto-responders (like out-of-the-office messages), make sure that 
they are not sent to the list nor to individual members. Doing so will cause 
you to be automatically removed from the list. 

To unsubscribe send a message with UNSUBSCRIBE in the subject line to 
salive@woodstone.nu
If you use auto-responders (like out-of-the-office messages), make sure that 
they are not sent to the list nor to individual members. Doing so will cause 
you to be automatically removed from the list.

Reply via email to