2

I am trying to run a batch file when some specific events occurs and I want to pass some null arguments to one of my tasks. The problem is that I don't know how. I have tried a lot of combinations but without success. My xml files looks something like:

    ........

      <ValueQueries>
            <Valuename="TargetUserName">Event/EventData/Data[@Name='TargetUserName']</Value>
            <Value name="EventID">Event/System/EventID</Value>
      </ValueQueries>

    ......

   <Exec>
      <Command>C:\passwd.bat</Command>
      <Arguments>$(TargetUserName) $(SubjectUserName) $(EventID) </Arguments>
    </Exec>

Now, I would like to pass an empty argument [between $(TargetUserName) and $(EventID)] for one of my events but I didn't manage to do this yet.

Any suggestions ?

2
  • If you're passing a null arg like that, you're just going to have to look at the total number of args within the batch. Try making the sometimes null the last arg "%3" otherwise you'll have trouble deciding which arg $(eventid) is. Why are you still using batch?! Use powershell or vbscript, much better support for arg parsing.
    – Clayton
    Dec 4, 2015 at 22:20
  • Thank you very much for your suggestion. I switched to PowerShell and then i specified "" to the Arguments list and it seems that it works.
    – Pandoranum
    Dec 10, 2015 at 6:28

0

You must log in to answer this question.

Browse other questions tagged .