7 Replies Latest reply on Aug 15, 2016 8:46 AM by Jason Schilling

    custom command using windows cmd

    Jason Schilling

      Just to start, I am rather new to BL and NSH Scripts in general. So if this question seems obvious, I apologize.


      Basically, I am just looking for a way to run a windows command across multiple servers. Something like:


      del c:\folder\*.bat /q


      Seems like it would be rather simple using custom commands, but I am have a problem getting it to work. My dirty work around was to create an empty package, deploy it and using the post command section under Phase Options to execute the one line command I need to run. I know this is not the best method to do this, but I needed it done quickly. Now that I have some time to research the proper way to do it...How do I go about doing this?


      I set up a new custom command using:

      Type: Remote

      Command: cmd.exe

      Command Options (I've tried a few):

      /c del c:\folder\*.bat /q

      /c del c:\\folder\\*.bat /q

      /c del "c:\folder\*.bat /q"


      Either way, none of them work. If I were to try it without the /c it will just drop me in that servers cmd prompt.