Windows 10: How to schedule ForFiles command on Shared Network drive

Discus and support How to schedule ForFiles command on Shared Network drive in Windows 10 News to solve the problem; Although the ForFiles command runs locally, you can use it on a shared network or mapped drive on Windows 10. If you want to schedule ForFiles command... Discussion in 'Windows 10 News' started by WinClub, May 25, 2021.

  1. WinClub New Member

    How to schedule ForFiles command on Shared Network drive


    Although the ForFiles command runs locally, you can use it on a shared network or mapped drive on Windows 10. If you want to schedule ForFiles command on a shared network in Windows 10, you can take the help of Task Scheduler. As you cannot run the command independently, it is required to create it separately before creating a task in Task Scheduler.

    We have shown the steps to create a .bat script to delete certain files older than six months for your information. However, you can customize it as per your requirements.

    To get started, open the Notepad or any other text editor you have on your computer and paste the following text:

    net use G: \\network-folder-path

    ForFiles /p "G:" /s /d -180 /c "cmd /c del /q @file"

    net use G: /delete

    Before saving, you have to make a few changes in the aforementioned lines. For example, in the first line, you have to enter the drive letter or network drive and the exact folder path you want to delete by replacing the network-folder-path text.

    In the second line, replace G with the original drive letter and 180 with the time you want. It is being calculated in day format.

    In the third line, replace the drive letter with your original drive letter. Once done, click on the File > Save As button.

    How to schedule ForFiles command on Shared Network drive schedule-forfiles-shared-network-drive-5.png

    Then, choose a file with .bat extension, select All Files from the Save as type drop-down list, and click the Save button. After that, you can move the .bat file to a place and keep it there.

    Once you are done with these aforementioned steps, you can create the task using Task Scheduler.

    How to schedule ForFiles command on Shared Network drive


    To schedule ForFiles command on a shared network in Windows 10, follow these steps:

    1. Search for task scheduler and click on the individual result.
    2. Click on the Create Task button.
    3. Enter a name > choose Windows 10 from Configure for list.
    4. Switch to the Triggers tab > click the New button.
    5. Choose On a schedule from Begin the task drop-down list.
    6. Choose Monthly option > set date > click OK.
    7. Switch to the Actions tab > click the New button.
    8. Click the Browse button > select the .bat script.
    9. Click the OK buttons repeatedly to save the change.

    To get started, search for task scheduler and click on the individual result to open the Task Scheduler app on your computer. Select the Task Scheduler Library on the left side and click on the Create Task option on the right side.

    How to schedule ForFiles command on Shared Network drive schedule-forfiles-shared-network-drive.png

    Enter a name for your task and make sure that the Windows 10 option is selected in the Configure for drop-down list.

    Switch to the Triggers tab, and click on the New button to create a new trigger for your task.

    How to schedule ForFiles command on Shared Network drive schedule-forfiles-shared-network-drive-1.png

    Now, choose On a schedule from the Begin the task drop-down list, select Monthly, and choose a date and month.

    How to schedule ForFiles command on Shared Network drive schedule-forfiles-shared-network-drive-2.png

    Click the OK button, switch to the Actions tab, and click on the New button to create the action for your task.

    How to schedule ForFiles command on Shared Network drive schedule-forfiles-shared-network-drive-3.png

    Make sure the Start a program option is selected in the Action drop-down list. Then, click on the Browse button, and choose the .bat script you created earlier.

    How to schedule ForFiles command on Shared Network drive schedule-forfiles-shared-network-drive-4.png

    Click on the OK button to save the change.

    There is one important setting you should turn on. It is called Run task as soon as possible after a scheduled start is missed. Let’s assume that your computer fails to run a scheduled task at a particular time on a specific date. If you enable this setting, it will run the task whenever it gets time, followed by the missed schedule.

    You can find this option in the Settings tab. All you need to is to make a tick in a checkbox and click the OK button.

    As long as you do not delete the script or change the network drive letter, you can use this method to schedule the ForFiles command on a shared network folder on Windows 10.

    How to schedule ForFiles command on Shared Network drive schedule-forfiles-shared-network-drive.png
    This article How to schedule ForFiles command on Shared Network drive first appeared on TheWindowsClub.com.

    read more...
     
    WinClub, May 25, 2021
    #1

  2. Cannot access shared network drive


    I could scream! so much time wasted on this stupid error, as if time is not precious enough!
    It probably would work fine if I could see the other computer! But I cannot see the other computer!
     
    sharonspost, May 25, 2021
    #2
  3. DTG1 Win User
    Cannot access shared network drive


    Personally, I wouldnt use Everyone. If anyone hacks into you, they have full access to everything and can demolish everything on your raid. I would rather set up accounts and access separately for each person. That way, I know who did all that damage. In the end with a little extra work, I feel more secure by using Authenticated Users.


    If this helps.
    step 1 create non-microsoft account and without email and address without admin rights
    step 2 share a drive or folder to specific user account (if Everyone is listed, remove it)
    step 3 set security > add Authenticated Users (if more than 1 account) or add specific users
    step 3a remove Everyone from list
    step 3b uncheck full control and write for all items listed except SYSTEM and Admin account.
    step 4 right click Start > Computer Management > System Tools > Shared Folders > Shares ... to verify settings and change anything else. You can also see the number of connections to each share here.
     
  4. How to schedule ForFiles command on Shared Network drive

    How to delete old share from showing up in network

    Use these steps to remove a mapped network drive using Command Prompt:



    1. Open Start.
    2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
    3. Type the following command to delete the mapped network drive and press Enter: net use d: /delete In the command, replace the “d” for the drive letter of the mapped drive you’re trying to remove.

      Code:
      In the command, replace the “d” for the drive letter of the mapped drive you’re trying to remove.

    4. Restart your computer.

    After you complete the steps, the mapped network drive should not longer be available on your device.
     
    FreeBooter, May 25, 2021
    #4
Thema:

How to schedule ForFiles command on Shared Network drive

Loading...
  1. How to schedule ForFiles command on Shared Network drive - Similar Threads - schedule ForFiles command

  2. ForFiles command lets you manage files & folders on Shared Network in Windows 10

    in Windows 10 News
    ForFiles command lets you manage files & folders on Shared Network in Windows 10: ForFiles command lets you manage or delete folders, complying with some criteria on Windows 10. If you want to use ForFiles command on a shared network folder or a mapped network drive, here is how you can do it using the Command Prompt. ForFiles is a command that you can...
  3. Share drive on network

    in Windows 10 Customization
    Share drive on network: The Windows 10 installation on a new Dell XPS is configured without the Everyone user for the C:\ object in the Security tab. So I can't share the drive. I can share folders, no problem. I tried adding Everyone, but got a series of errors related to in use files and...
  4. Help using Forfiles command

    in Windows 10 Network and Sharing
    Help using Forfiles command: Hello everyone, I am having a syntax error when executing my forfiles command. My proposal is to develop a .bat script to everyday copy the last file backup from a folder to the one drive folder located in another drive "K" This is the command I am using forfiles...
  5. How to save backup on a network shared drive

    in Windows 10 Installation and Upgrade
    How to save backup on a network shared drive: Hi, I want to save my backup on a network shared drive. I'm able to do a "map network drive" and "add a network location" to this location. However when I want to select this location for my backup I get an error message. Please see attachments for the error message. Any...
  6. Sharing Drives on a network server

    in Windows 10 Network and Sharing
    Sharing Drives on a network server: I have setup a wireless networking server and all pc have access to the server C: drive But I don't want this as i have 5 other drives on the server and these are the ones I require all the PC to have access to they can see them but can not save to them. Please advise how I...
  7. Shared Network Drive

    in Windows 10 Network and Sharing
    Shared Network Drive: I can no longer access my shred network drive. When I try to reconnect my other machine ask for credentials. Both machine use my one Microsoft account. I did not have this problem until a few days ago. Up until then it had been working fine. What is causing this problem and...
  8. Forfiles error

    in Windows 10 Customization
    Forfiles error: I am running Windows 10 and upon startup I am getting a notification titled C:\WINDOWS\system32\forfiles.EXE...sometimes it loads Errors and other times it remains blank. My computer performance does not seem to be impacted. Can anyone advise?...
  9. shared network drive

    in Windows 10 Network and Sharing
    shared network drive: I am using Windows 10 version 1809 build 17763.292 and have set up my home private network. Why do I have to keep doing a network reset on my main computer in order for my notebook to be able to connect to my shared usb drive?...
  10. How to connect to Shared Network drive when not on the network?

    in Windows 10 Network and Sharing
    How to connect to Shared Network drive when not on the network?: How do I connect to a shared network drive I have setup on my Windows 2012 R2 standard server at home, from my Windows 10 pro laptop is at work? Do I have to setup a vpn on windows 2012 server and connect to it from my laptop? Someone told me something about doing it that...