How to Delete a File/Folder at Logon [GPO Script Settings]

Since I started, there has been a GPO in place, but I just learned that it is not performing its intended function. Since this platform might occasionally transmit sensitive information between agents and supervisors, it was determined that these logs should be frequently removed. How to delete a file/folder at logon?

Best Answered by

Dany· Answered on Feb 22, 2023

We think the GPO logon/logoff script performs well for your situation. Let us check how to use your computer's logon and logoff script.

1. Start by launching the Local Group Policy Editor.

2. In the console tree, choose Scripts (Logon/Logoff). User ConfigurationWindows SettingsScripts (Logon/Logoff) is the route.

3. Double-click Logon/Logoff in the results box to begin.

4. Click "Add" in the Logon/Logoff Properties dialog box.

5. Type the script's path into the Script Name field or click "Browse" to look for the script file in the domain controller's Netlogon shared folder. Type whatever parameters you like in the Script Parameters box in the same manner as you would on the command line. For instance, type /logo /I if your script includes the parameters /logo (display banner) and /I (interactive mode).

6. The Logon/Logoff Properties dialog box provides a list of all the scripts that are presently assigned to the chosen GPO. When numerous scripts are assigned, they are executed in the sequence you choose. Click a script and then choose "Up" to move it up the list. Click a script in the list, then click "Down" to move it down.

After using the logon/logoff script, the files can be deleted normally. If you find some important sensitive files are deleted, you can download a third-party recovery tool to recover lost files. EaseUS Data Recovery Wizard can help you do that. This data recovery software can help you recover files after reinstalling Windows, partition loss, virus attacks, etc.

Use EaseUS Data Recovery Wizard to recover deleted or lost files easily and quickly.

Tutorials on how to recover lost, deleted, or formatted data from HDD, SSD, USB, SD card, or other storage media on Windows and Mac.

People Also Ask

How to Delete Photoshop Temp Files on Windows 10

If your hard drive gets full because of Photoshop temp files, you must learn about this page. You can know the Photoshop temp files' location and whether it is safe to delete Photoshop temp files on Windows 10. Then, you can delete Photoshop temp files with ease.


Mar 09, 2023

How to Fix It Takes a Long Time to Delete Files in Windows

Why does Windows take so long to delete files and clear the recycle bin? This problem will occur when I am trying to delete plenty of small files on Windows. How can I fix this Windows issue?


Feb 22, 2023

How to Delete Files Across a Domain Remotely

You can configure a shortcut item to solve this problem. Using the Shortcut preference settings, you can configure a shortcut to a file system object. Before you build a Shortcut preference item, you should examine the behavior of each sort of action that this extension supports.


Mar 10, 2023

How to Recover Latest Windows Update Deleted Files

After the latest Windows update, it is possible that some files are deleted. We will introduce some available methods in this passage to help you recover the latest Windows update deleted files.


Mar 09, 2023

How to Recover Deleted .lnk Files on Windows 10

Have you ever experienced files with .lnk extensions being deleted, and you can not find the document anywhere? This post offers two methods to recover deleted .lnk files on Windows. Read the post to find out solutions.


Apr 28, 2023

How to Delete All Files That Do Not Match Criteria

Do you want to learn how to remove a file using a script? Don't worry because this post will show you how to delete numerous files with the Remove-item cmdlet and how to delete files that do not match the criteria.


Mar 10, 2023