locked
Allowing Users to Create folders or files on desktop by .bat file RRS feed

  • Question

  • Dear Microsoft,

    I had disabled the user to create file in desktop using a script which I had seen in the forum, script which I has used in Echo Y| cacls %userprofile%\desktop /P %username%:R  and created a .bat file, it worked well and disabled user access to save files in desktop. Now I need to enable the access. Please help me to make the changes in the script or to write a new script to enable the access

    With Warm Regards,

    Subin Thomas

    • Moved by Bill_Stewart Friday, December 5, 2014 11:07 PM Abandoned off-topic question
    Sunday, November 9, 2014 8:52 AM

Answers

  • Echo Y| cacls %userprofile%\desktop /P %username%:R  save this in to .bat file and run as administrator..DONE

    Since %UserProfile% and %UserName% can have embedded spaces, you should surround both with double quotes in order to make your script robust. Furthermore, by giving users read-only access to their own desktop, your popularity rating is likely to drop dramatically. "Full access" might be more appropriate.

    echo Y| cacls "%userprofile%\desktop" /G "%username%":F

    • Proposed as answer by Frederik Long Monday, November 24, 2014 11:36 AM
    • Marked as answer by Bill_Stewart Friday, December 5, 2014 11:07 PM
    Sunday, November 9, 2014 10:18 AM

All replies

  • Echo Y| cacls %userprofile%\desktop /P %username%:R  save this in to .bat file and run as administrator..DONE
    Sunday, November 9, 2014 9:40 AM
  • Echo Y| cacls %userprofile%\desktop /P %username%:R  save this in to .bat file and run as administrator..DONE

    Since %UserProfile% and %UserName% can have embedded spaces, you should surround both with double quotes in order to make your script robust. Furthermore, by giving users read-only access to their own desktop, your popularity rating is likely to drop dramatically. "Full access" might be more appropriate.

    echo Y| cacls "%userprofile%\desktop" /G "%username%":F

    • Proposed as answer by Frederik Long Monday, November 24, 2014 11:36 AM
    • Marked as answer by Bill_Stewart Friday, December 5, 2014 11:07 PM
    Sunday, November 9, 2014 10:18 AM