none
Clear Content.MSO VBS | Whenever Users Login/Logoff RRS feed

  • Question

  • Good-day,

    Can I please request some help on a script which will delete all the contents within this folder :

    C:\Users\USERNAME\AppData\Local\Microsoft\Windows\INetCache\Content.MSO

    I do not want to delete the Content.MSO folder, just all the stuff within this folder. It needs to delete all the contents when the user logs on (I want to embed this as a logon script)

    Our environment :

    Server 2012 R2 (RDS Server)
    User Profile Disks (On another file server)

    Please could someone assist I am desperate...

    Friday, April 24, 2015 8:38 AM

Answers

  • Good-day,

    Can I please request some help on a script which will delete all the contents within this folder:

    You do not need a script. You need a very, very basic console command:

    del /s /q "%UserProfile%\AppData\Local\Microsoft\Windows\INetCache\Content.MSO\*.*"

    You must test the command from a Command Prompt before putting it into your logon script. In case it does not work, report exactly what happens. Do not write "It does not work" because this is wide open to interpretation.

    Friday, May 8, 2015 12:26 PM

All replies

  • del C:\Users\USERNAME\AppData\Local\Microsoft\Windows\INetCache\Content.MSO\* -recurse -force


    \_(ツ)_/

    Friday, April 24, 2015 9:32 AM
  • Doesn't work
    Friday, May 8, 2015 12:06 PM
  • Good-day,

    Can I please request some help on a script which will delete all the contents within this folder:

    You do not need a script. You need a very, very basic console command:

    del /s /q "%UserProfile%\AppData\Local\Microsoft\Windows\INetCache\Content.MSO\*.*"

    You must test the command from a Command Prompt before putting it into your logon script. In case it does not work, report exactly what happens. Do not write "It does not work" because this is wide open to interpretation.

    Friday, May 8, 2015 12:26 PM
  • Just an additional note, if you're configuring Group Policy in Server 2012 R2, there is a default delay of 5 minutes before logon scripts are run. 

    Cause
    This behavior occurs because Windows 8.1 includes a new Group Policy setting, "Configure Logon Script Delay," that controls the behavior of logon scripts. This script is stored in the following location:

    Computer Configuration\Administrative Templates\System\Group Policy
    The default value setting for the "Configure Logon Script Delay" policy is Not Configured. However, the default behavior of a Group Policy client is to wait five minutes before it runs logon scripts.

    The goal of the five-minute delay is to speed up the loading of the user's desktop on Windows 8.1-based computers.  

    Resolution
    If you want the logon scripts to run at user logon without any delay, you should configure the setting to Disabled:

    Computer Configuration\Administrative Templates\System\Group Policy: Configure Logon Script Delay ==> Disabled
    If you want to change the time that the Group Policy client waits until it runs the logon scripts, you can set the time in minutes:

    Computer Configuration\Administrative Templates\System\Group Policy: Configure Logon Script Delay ==> Enabled
    Then, in the options section, set minute to the desired value. The maximum value that you can enter is 1,000 minutes.

    After you set the policy to Enabled and set the time in minutes, the Group Policy client waits for the specified time before it runs logon scripts at user logon. If you enter the time in minutes as zero (0), the setting is disabled, and the Group Policy client runs the logon scripts at user logon without any delay."

    support.microsoft.com/en-us/help/2895815/logon-scripts-do-not-run-for-five-minutes-after-a-user-logs-on-to-a-windows-8.1-based-computer


    • Edited by DaTink Wednesday, April 12, 2017 11:41 AM Unable to include link to original article.
    Wednesday, April 12, 2017 11:39 AM