Problem accessing folders from command line


  1. Posts : 4
    Windows 7 x64
       #1

    Problem accessing folders from command line


    I'm trying to use Winzip to back up the My Documents folder onto another drive. Win7 keeps saying it cannot find the path specified. Here are my command line options being run from a batch file:


    PATH=%PATH%;C:\_Bin (wzzip.exe is stored here)

    c:
    cd\users
    takeown /f George
    icacls George
    "cd\Users\George\My Documents"

    This is where I get the path error message. What am I doing wrong?
      My Computer


  2. Posts : 3,139
    Systems 1 and 2: Windows 7 Enterprise x64, Win 8 Developer
       #2

    Try setting the path here:

    How to set the windows path in Windows 7
      My Computer


  3. Posts : 4
    Windows 7 x64
    Thread Starter
       #3

    Problem Solved


    Lemur,

    OK what I had to do is right-click on my own My Documents folder and select "Properties, Security" then give myself full permissions of all subfolders. Once I did that I was able to change into those directories from anywhere or include those directories in a path for Winzip.

    Also it seems like Win7 while in the Command Environment doesn't recognize the folder My Documents but rather refers to it as Documents even though it displays as My Documents in the Windows Explorer.

    I spent the whole day trying to get this to work. Why on earth Microsoft took a simple thing and made it a head ache is beyond me. Thanks for replying to my thread.
      My Computer


  4. Posts : 4
    Windows 7 x64
    Thread Starter
       #4

    Forgot to add the contents of my batch file for those who might find it useful:

    :set the path to wzzip.exe
    path=c:\_bin

    :change to folder I want to archive
    cd\users\george\documents

    :command to archive all files & folders in My Documents
    wzzip -i -r -P E:\george\Docs.zip *.*


    BTW Lemur, I was able to set paths from within the batch file instead of modifying the system variable.
      My Computer


  5. Posts : 3,139
    Systems 1 and 2: Windows 7 Enterprise x64, Win 8 Developer
       #5

    What about a different test? Also, put a space after "cd"

    Code:
    :set the path to wzzip.exe
    path=c:\_bin
     
    :change to folder I want to archive
    cd \users\george\documents
     
    :command to archive all files & folders in My Documents
    dir *.* > test.txt
    Just to see if we are making it to that directory
      My Computer


  6. Posts : 4
    Windows 7 x64
    Thread Starter
       #6

    Yep, I'm making it to "users\george\documents" now but I had to go into "Properties, Security" and take ownership of the Documents folder first, otherwise Win7 wouldn't let me go into that folder. It appears that by default Win7 takes ownership of folders when you are working in the command environment, that's what happened in my case anyway. I later took ownership of the entire C: drive because Win7 wouldn't let me CD into other folders either.

    Thanks for your help with this Lemur, it's much appreciated.
      My Computer


  7. Posts : 3,139
    Systems 1 and 2: Windows 7 Enterprise x64, Win 8 Developer
       #7

    Sedgrick said:
    Yep, I'm making it to "users\george\documents" now but I had to go into "Properties, Security" and take ownership of the Documents folder first, otherwise Win7 wouldn't let me go into that folder. It appears that by default Win7 takes ownership of folders when you are working in the command environment, that's what happened in my case anyway. I later took ownership of the entire C: drive because Win7 wouldn't let me CD into other folders either.

    Thanks for your help with this Lemur, it's much appreciated.
    Glad it's resolved!
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:07.
Find Us