The .BAT file doesn't know %p 

The .BAT is called with the CONTENT of %p 

And (if I remember well how BAT files work) the 1st parameter the .BAT receives 
is seen a %1, the 2nd as %2 , … 

BUT a SPACE does separate the parameters from each other. 

 

Example 

                pretty name is : This is a test 

                if you call 

                                mybatch.bat %p 

                then it's send to the OS as 

                                mybatch.bat This is a test 

 

                From the OS point of view the .BAT is then called with 4 
parameters being 

                                This 

                                is 

                                a 

                                test 

                (spaces are the separators between the parameters for the OS) 

 

 

 

dirk 

 

From: Servers Alive Discussion List [mailto:sal...@woodstone.nu] On Behalf Of 
PatriceH
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. 

Reply via email to