Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

attrib syntax...

Posted on 2001-08-27
11
Medium Priority
?
473 Views
Last Modified: 2013-12-03
Hi.
Not sure if this is the right place to ask a DOS question, but here goes...

I'm trying to recursively change the file properties in a directory (it came off a CD-ROM so all the files are 'read-only' in a directory tree). I'm trying this but it ain't working -

ATTRIB [-R] [[C:\][MYDOCU~1\DECCA\DOCROOT\]] [/S]

I'm getting the error

'Parameter value not allowed - [-R]

the directory is C:\MYDOCUMENTS\DECCA\DOCROOT\ and I want to change the properties of all files within that and nested directories...

The machine is running Win98 if that matters...

anyone any ideas?

Ian
0
Comment
Question by:cath
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
11 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 6428223
Leave out the [].  So the command is:

ATTRIB -R C:\MYDOCU~1\DOCROOT\ /s
0
 
LVL 32

Expert Comment

by:jhance
ID: 6428247
By the way.  A hint on syntax.  When you see the documentation give parameters in [] like:

ATTRIB [-R]...

It means that the parameter is OPTIONAL.  So you can leave it out if it's not necessary.  The ATTRIB command for example says:

ATTRIB [+R | -R] ...

That means that you can have:

ATTRIB
ATTRIB +R
ATTRIB -R

and all are legal syntax.  Note that this command does not require ANY parameters so you can issue:

ATTRIB

This will just display the settings for all the files in the current directory.
0
 

Author Comment

by:cath
ID: 6431231
I'm getting 'path not found' when I do this:

ATTRIB -R C:\MYDOCU~1\DECCA\DOCROOT\ /s

and yet the path (unshortedned to 8.3) is

c:\my documents\decca\docroot\

yet if I put that into the ATTRIB string (ie include the space after 'my' and the full string for 'documents') I get 'parameter value not allowed' - I guess cause it doesn't like the space.

any ideas?

DOS, God love it, huh?

Ian

0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
LVL 32

Expert Comment

by:jhance
ID: 6431429
Then try it like:

ATTRIB -R "c:\my documents\decca\docroot" /s
0
 

Author Comment

by:cath
ID: 6453704
nope, says 'File not found - c:\my documents\decca\docroot

I tried it with a trailing \ as well (ie ..\docroot\)

and got path not found...

annoying...

any ideas?

Ian
0
 
LVL 32

Accepted Solution

by:
jhance earned 400 total points
ID: 6453719
You are trying the name wrong.

Either you have the name itself wrong or you are not typing it is as you have said.  Either way, it's wrong.

Try the:

DIR /X

command and make sure you have the correct SHORT FILE NAME for this folder.  Are you 100% that there is not a filename extension at the end?  A folder (as well as a file) can be named like "filename.xxx".  So your folder might be named:

C:\My Documents\DECCA\DOCROOT.000

or something.  It's easy to miss the filename extension since the DIR command leave a space.
0
 

Author Comment

by:cath
ID: 6453994
well I can't see a filename extension on the end of the directory...

I do DIR /P

and I get a list of directories of which one is

MYDOCU~1

so then I try

ATTRIB -R "C:\MYDOCU~1\DECCA\DOCROOT" /s

and then I try

ATTRIB -R "C:\MY DOCUMENTS\DECCA\DOCROOT" /s

and neither works. Both times I get 'File not found...'

I mean what _is_ it with DOS? This is so easy in Linux...

I appreciate your help, though... ;-)

Ian
0
 
LVL 32

Expert Comment

by:jhance
ID: 6454198
OK, then try...

ATTRIB -R C:\MYDOCU~1\DECCA\DOCROOT\*.* /s
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question