简体   繁体   中英

Create accessible directories with mkdir or md Windows

I'm trying to run a batch script for our WinPE disk, and I want ImageX to back up to a user defined portable hard drive. However, ImageX will not save to a folder or location if it doesn't exist. So I'm running a check inside the batch file to see if the directory exist. If it doesn't, then it creates the directory. My problem is once the directory is created, and ImageX tries to write to it, it errors out and says "Access is denied."

Is there a way for me to create a directory that lets anyone read or write to it in Windows Command Prompt? The cmd prompt is already running as an Administrator within Windows PE.

After you create the directory you can try using the icalcs command to change the permissions.

You can give Full access a user by running this command:

icacls <Directory> /grant <User>:F

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM