Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Problem accessing folders from command line

13 Jan 2012   #1

Windows 7 x64
 
 
Problem accessing folders from command line

I'm trying to use Winzip to back up the My Documents folder onto another drive. Windows 7 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 System SpecsSystem Spec
.

13 Jan 2012   #2

Systems 1 and 2: Windows 7 Enterprise x64, Win 8 Developer
 
 

Try setting the path here:

How to set the windows path in Windows 7
My System SpecsSystem Spec
13 Jan 2012   #3

Windows 7 x64
 
 
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 Windows 7 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 System SpecsSystem Spec
.


13 Jan 2012   #4

Windows 7 x64
 
 

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 System SpecsSystem Spec
13 Jan 2012   #5

Systems 1 and 2: Windows 7 Enterprise x64, Win 8 Developer
 
 

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 System SpecsSystem Spec
14 Jan 2012   #6

Windows 7 x64
 
 

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 Windows 7 wouldn't let me go into that folder. It appears that by default Windows 7 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 Windows 7 wouldn't let me CD into other folders either.

Thanks for your help with this Lemur, it's much appreciated.
My System SpecsSystem Spec
14 Jan 2012   #7

Systems 1 and 2: Windows 7 Enterprise x64, Win 8 Developer
 
 

Quote   Quote: Originally Posted by Sedgrick View Post
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 Windows 7 wouldn't let me go into that folder. It appears that by default Windows 7 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 Windows 7 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 System SpecsSystem Spec
Reply

 Problem accessing folders from command line




Thread Tools



Similar help and support threads for2: Problem accessing folders from command line
Thread Forum
add folders in indexing options using registry or command line? Performance & Maintenance
SQL Server 2012 command line install problem Windows 7 64;MEDIALAYOUT Installation & Setup
"there was a problem sending a command line to program" General Discussion
libraries and the command line Performance & Maintenance
How to run a command line utility? General Discussion
Command Line General Discussion
Can you boot from the command line? Chillout Room

Our Sites

Site Links

About Us

Find 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 03:47 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33