Delete Files Older Than X Days with ForFiles Command
You can quickly delete files older than X days with ForFiles Command. Follow the given steps below to use CMD delete files older than x days:
Step 1. Left-click the Windows main menu and search for Command Prompt. Right-click the result and select the "Run as administrator" option.
Step 2. Type in ForFiles /p "C:\path\to\folder" /s /d -X /c "cmd /c del /q @file" to delete files on Windows that haven't been modified in the last X days and press Enter. In the command, change "C:\path\to\folder" specifying the path to the folder you want to delete files and change /d -X to select files with a last modified date.
ForFiles command breakdown
/p - indicates the pathname to start searching.
/s - instructs ForFiles to search inside subdirectories.
/d -specifies the last modified date for a file.
/c - instructs ForFiles to execute the command (must be wrapped in double quotes). The default is "cmd /c del @file".
/q -allows deleting folders without requiring confirmation.
It is possible to have 3 states when it comes to OneDrive files.
- Always available
- Locally available
- Online-only
See this link for full details: Set Files On-Demand states in Windows - SharePoint in Microsoft 365 | Microsoft Learn
I'm backing up some files that would fill up the C drive so each time I backup a file I unpin it. My OneDrive can hold 5TB so now I can keep lots more data when unpinned.
This is an example of how to unpin locally and save space. This is excellent in batch files for multiple files/folders.
attrib +u "C:\Users\[username]\OneDrive - [Company Name]\[FolderName]\*.*"
This can also be accomplished by using the right click menu in Windows Explorer.
When you try to connect to join a domain on any Windows operating system or after entering a username and correct password, you may receive an error with the message “the specified domain either does not exist or could not be contacted”.
This “the specified domain does not exist or could not be contacted” error is usually due to invalid DNS settings on the workstation, as Active Directory requires domain DNS (not the router’s address) to function properly. The error can also occur because IPv6 does not work.
Go to Control Panel. Network and Sharing Center - Chang adapter settings - Properties and uncheck IPv6. Note that in Windows 11 this is the ONLY way to disable IPv6!
You're Very Welcome :-)
From here: https://serverfault.com/questions/396722/your-system-administrator-does-not-allow-the-use-of-saved-credentials-to-log-on
If you don't want to change local or server side GPOs:
Go to Control Panel
-> Credential Manager
on the local computer you are trying to connect from.
You will see three sections:
- Windows Credentials
- Certificate-Based Credentials
- Generic Credentials
Remove the credentials from Windows Credentials
and add it to Generic Credentials
.
Question and solution here: https://superuser.com/questions/402070/run-task-scheduler-task-on-demand-from-limited-user-account-in-windows-7
Go to C:\Windows\System32\Tasks find the related task and assign "read and execute" rights to the user you want to be able to access it. Be sure to assign to "current object only." Then the task will be visible and runnable from the limited user, and it will work if you saved your credentials in it and checked "run whether user is logged on or not."
From here: https://social.technet.microsoft.com/Forums/exchange/en-US/46e1cd52-52b3-4427-88a3-200f87319e23/remote-desktop-authentication-error-has-occurred-the-function-requested-is-not-supported?forum=w7itpronetworking
Here is the FIX for this issue ..
Change the Group Policy on your local client to use the vulnerable setting
Run: gpedit.msc
Go to à Computer Configuration -> Administrative Templates -> System -> Credentials Delegation -> Encryption Oracle Remediation
Open - Encryption Oracle Remediation à choose Enable à change protection level àVulnerable à Apply
Specificy for Windows 7.
Please try Disable the generation of thumbs.db files by the Local Group Policy Editor and your problems will be resolved. They are only generated for compatibility with outdated applications, and are most certainly NOT needed for Windows operation.
Run "Group Policy" - select Edit Group Policy when it comes up.
> User Configuration
> Administrative Templates
> Windows Components
> Windows Explorer
From here: https://blogs.technet.microsoft.com/enterprisemobility/2009/07/01/using-multiple-monitors-in-remote-desktop-session/
If your RDP's "Use all my monitors for the remote session" is disabled you can get around it as follows.
1. Create an RDP file with your specific connection.
2. Right click on the .rdp file and select Open with Notepad.
3. Add the following 2 lines to the bottom.
span monitors:i:1
use multimon:i:1
4. Save and then use!
Have a great day!
Windows only: If you've ever come back to your PC and noticed it was rebooted, you might be curious to know exactly when it was shut down?
To figure out when your PC was last rebooted, you can simply open up Event Viewer, head into the Windows Logs -> System log, and then filter by Event ID 6006, which indicates that the event log service was shut down—one of the last things that happens before a reboot. This technique won't help you figure out when there was a power outage, but you can filter by Event ID 6005 to see when the system was last turned on—that event shows when the event log service was started again.
It's a simple tip, but could come in handy if you come back to your PC and want to figure out whether Windows Update or somebody else restarted your PC in the middle of the night, or you're just curious how many times you've rebooted in the recent past.