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

    How to change directory in NSH script

      Hi,

       

      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.

       

      Thanks,

      Eyal

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

          I would make sure your scripting has the following:

          #!/bin/nsh

           

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

           

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

          echo -n "Current Working Directory = "

          pwd

           

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

           

           

          HTH

           

          Mike

           

           

           

           

          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:

            //TestVM/c/

            //TestVM/c/Temp

             

            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.

             

            Thanks,

            Eyal