Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

sd_event using parameters

SOLVED
Go to solution
Highlighted
Gail D
Collector

sd_event using parameters

I have a .bat file that runs monthly from the windows scheduler to create a new SC ticket for monthly PM.

PM.bat runs
sd_event -f sd_event.ini -v event_id=123

once a ticket is created with event_id=123, it will not create another ticket because event_id=123 is unique. How can I pass a parameter event_id=%1 or another cmd that will change monthly?

thanks,
gail
3 REPLIES
Tim Schmitt_4
Frequent Visitor
Solution

Re: sd_event using parameters

Hi Gail.

I've used a small program that auto increments a number in a batch file to provide a unique id. I tried to find an example of sd_event using this number but I cannot find the batch program.

If you look at this example, you can see how the auto number works in a batch file. Since you only perform the exchange monthly, you probably won't need a lot of unique numbers although you may need to be careful if there are several programs using sd_event through batch.

You might also be able to use the date and time from the machine as a unique variable by calling the date command from inside the batch and storing it in a variable.

http://www.ericphelps.com/batch/samples/addition.txt
Gail D
Collector

Re: sd_event using parameters

Tim,

Thanks for the info it is very helpful. I think I going to call the system date because i was just task with a weekly automation ticket.

thanks, gail
JaS_4
Honored Contributor

Re: sd_event using parameters

Gail, for my testing, I normally used the dos time date &time env var. %date%%time%.
//Add this to "OnDomLoad" event