1.

Solve : Modifying attibutes through batch file?

Answer»

I have a file: IPC.log in my C: drive.
In command prompt attrib IPC.log SHOWS
SHR C:\IPC.log
(S-System, H-Hidden, R-ReadOnly)

Now I want to create a batch file which on double click
1. CHANGES the attirbutes of this file then
2. Copies this file to my D:\ drive
3. Then again changes the files attibute as original.

Is it possible ?
I tried writing simple commands in notepad and save it as a batch files, but on double click NOTHING happens.
My batch file was:

attrib IPC.log -s -h -r
copy IPC.log D:\
attrib IPC.log +s +h +r

Can any one help ??.....Thanks in advance...Put the switches before the file name.

attrib -s -h -r ipc.log
copy c:\ipc.log d:\
attrib +s +h +r ipc.log


Hi Dude,

Try out this,

xcopy /K /I c:\ipc.log d:\ipc.log


This commad will copy the file without making a check for the attributes and the destined filed will also have the same attribute as the source file.
Thanks Contrex you made my BASICS correct and thanks HITESH you told me exactly I m wishing to do.....



Discussion

No Comment Found