13 Replies Latest reply on Oct 10, 2013 4:07 AM by Sanket Bakare Branched to a new discussion.

    Bladelogic NSH command issue

    Sanket Bakare

      Hi All,


      I am trying to execute windows command like -- net start "service name" .


      I can successfully execute this command on windows command prompt


                >net start "Windows Audio"

                The Windows Audio service is starting.

                The Windows Audio service was started successfully.


      However while executing same command through nsh script its giving me error


                % ./ReStart_Service.nsh "server name" "Windows Audio"

                The syntax of this command is:


                NET STOP



                Windows Audio

                The service name is invalid.


                More help is available by typing NET HELPMSG 2185.


      I tried to use escape characters in script and on nsh prompt as well.


      if I use the different service name which doesn't have space then nsh script works fine.


      nsh script contains


                nexec -i $1 cmd.exe /c "echo | net stop $2"

                echo "$2"

                nexec -i $1 cmd.exe /c "echo | net start $2"