2 Replies Latest reply on Mar 10, 2011 10:40 AM by Eyal NameToUpdate

    How to change directory in NSH script



      what is the command to change the current working directory in NSH script?


      When I executed "pwd" command, I got "//TestVM/C/"

      (yeah, it's a windows server called TestVM).


      I tried "cd" but the command is not recognized.


      I'm running an NSH script that creates a zip, and unless I change the current working directory,

      the files in the zip keep the entire path.




        • 1. Re: How to change directory in NSH script

          I would make sure your scripting has the following:



          I am able to execute the following where PROPSYSROOT is my Windows Installation Folder.


          cd "//${SERVERNAME}${PROPSYSROOT}/Temp"

          echo -n "Current Working Directory = "



          Info Mar 2, 2011 2:26:35 PM Current Working Directory = //SCHDEV11/c/WINDOWS/Temp










          1 of 1 people found this helpful
          • 2. Re: How to change directory in NSH script

            Hi Mike,


            Thanks for the quick reply - you give me the lead.


            Appearntly, the correct command is without the server name...



            I'm running this:

            pwd > /c/temp/test_nsh.log

            cd "/C/Temp"

            pwd >> /c/temp/test_nsh.log



            even though the output in the log file is:




            The change directory command is without the server name.


            Maybe it's new in Blade Logic 8 SP6 ?


            about the shebang line #!/bin/nsh - what ahould it be for windows? the interpreter is obviously not in the path /bin/usr on windows.