Jump to content

Windows 11 and automatic cleaning script


alf9872000
Go to solution Solved by Akaneharuka,

Recommended Posts

Hi,

 

With my PC running Windows 10 Pro, i use a script to clean folders, recycle bin, automatically each time the PC is restarted.

I use the Group Policy Editor (gpedit.msc) to do that; the script (.bat file) is placed in C:\Windows\System32\GroupPolicy\Machine\Scripts\Shutdown.

 

Example of lines in the script:

RD /S /Q "C:\Users\<user>\AppData\Local\Temp"

RD /S /Q "C:\Windows\Prefetch"

RD /S /Q "C:\Windows\SoftwareDistribution\Download"

RD /S /Q "C:\Windows\temp"
RD /S /Q "C:\$RECYCLE.BIN"

 

I have a new laptop under Windows 11 Home; i have enabled the gpedit.msc, but the script doen't work; folders and recycle bin do not go empty.

 

Any idea ?

Thanks.

 

  • Like 1
  • Sad 1
Link to comment
Share on other sites


  • Solution

since Windows 11 Home ignores some group policies. MS restricts choices, e.g. Windows S and Home.

Best thing to do is to upgrade to Windows Pro. 

https://superuser.com/questions/1758761/schedule-a-task-to-run-before-computer-goes-to-hibernate

Edited by Akaneharuka
Link to comment
Share on other sites


Thanks for answers.

My laptop is an Acer Aspire 5 A517-52.

After booting on a bootable USB key, the installation setup asks where to install Windows but no partition is visible ?

 

Thanks for your help.

 

Link to comment
Share on other sites


@Akaneharuka

I already tried with Rufus; don't work; i think have found the solution.

My processor is an 11th generation (Intel Tiger Lake) and it is necessary to install the IRST (Intel® Rapid Storage Technology) driver.

You must copy the folder which contains the IRST files on the bootable USB key.

During installation, at the stage where you have to select a partition (which is not visible), you have to load the IRST driver to make the partition appear.

 

I will test it.

  • Like 1
Link to comment
Share on other sites


  • 1 month later...
On 12/24/2022 at 7:36 AM, alf9872000 said:

@Akaneharuka

I already tried with Rufus; don't work; i think have found the solution.

My processor is an 11th generation (Intel Tiger Lake) and it is necessary to install the IRST (Intel® Rapid Storage Technology) driver.

You must copy the folder which contains the IRST files on the bootable USB key.

During installation, at the stage where you have to select a partition (which is not visible), you have to load the IRST driver to make the partition appear.

 

I will test it.

@alf9872000 I'm not sure if it's too late, but did your solution work? I've stopped using Rufus ever since I discovered Ventoy - https://github.com/ventoy/Ventoy. You can also change your version of windows using the MAS script - https://github.com/massgravel/Microsoft-Activation-Scripts/releases.

I've updated my windows version to Enterprise as all features work well.

Link to comment
Share on other sites


@nsaner2006

1. To use the Group Policy, you need a Pro version of Windows (i now have a Pro version; it's OK)

2. About the problem of 'invisible' partition during installation of Windows, it's solved. It is necessary to install the IRST (Intel® Rapid Storage Technology) driver; without this, the installation is impossible, either with [Windows] Media Creation Tool, Rufus or Ventoy.

Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...