| 1. |
Solve : ICACLS command line doubts.? |
|
Answer» Good Morning. I think you may have put extra spaces in your command line above. This checks all fixed disks: Thank you very much for the quick response. This command line that you passed, somehow is giving error. Code: [Select]\ Hardware_Test: The filename, directory name, or volume label syntax is incorrect. Successfully processed 0 files; Failed processing 1 files \ Hardware_Test: The filename, directory name, or volume label syntax is incorrect. Successfully processed 0 files; Failed processing 1 files \ Hardware_Test: The filename, directory name, or volume label syntax is incorrect. Successfully processed 0 files; Failed processing 1 files Changing the command line, in place of ICACLS I put ECHO %% d, the result gave this: Code: [Select]C: D: E: I looked at the FOR command (which I did not know) and saw that it was all right (for me at least). Because the command is transforming the C: | D: | E: in variable %% d. You are then placing this variable in place of the Local Disk before the rest of the folder. What could be making this mistake? OBS: The second alternative that you showed me, worked, but I liked this first more. OBS2: As test in the computer has the Local Disk C, D and E.Where did you get that ICACLS command from? It isn't right. Code: [Select]ICACLS C: \ Hardware_Test / grant "All: (OI) (CI) F" "Administrator: (OI) (CI) F" / TI fixed the FOR structure, and more importantly your ICACLS syntax. Did you even test it? You may have to get proper ICACLS permissions for this to work. I cannot help you with that. Code: [Select]@echo off for /f "skip=1 tokens=1-4 delims= " %%a in ('wmic logicaldisk get caption^,providername^,drivetype^,volumename') do ( if "%%b"=="3" ICACLS %%a:\Hardware_Test /grant "All:(OI)(CI)F" "Administrator:(OI)(CI)F" /T ) Oh REALLY? I'm a beginner in this area, I needed to automate the folder permissions, so I simply went searching and searching until I found something and GOT this command. Now, if it's not right, I need more help if it's not uncomfortable . Let me keep you abreast of the SITUATION, many times (for reasons I do not know) the folders of a program (where I work) and the folder PRINTERS, lose permission on some clients, causing them to have to release all manually. I thought about creating a script that would automatically free these folders. But as I said, it depends on the client gets on the local disk C another in D and etc. Can you help me? EDIT: I saw your second answer after I sent you my message, I'll test it. Thank you very much. |
|