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 ?

Pandoranum
  • 51
  • 1
  • 5
  • 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 04 '15 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 '15 at 06:28

0 Answers0