Windows 10: Help using Forfiles command

Discus and support Help using Forfiles command in Windows 10 Network and Sharing to solve the problem; 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... Discussion in 'Windows 10 Network and Sharing' started by Luis Soriano _ER, Dec 3, 2020.

  1. 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 /p D:\Micros\Database\Data\Backup\Archive\ /D +0 /C "cmd /c copy @file K:\OneDrive\OneDrive - Company Name Inc\Backups"

    My ouput result:


    The syntax of the command is incorrect.


    Thank you to all for your help!

    :)
     
    Luis Soriano _ER, Dec 3, 2020
    #1
  2. Naki Win User

    GPU-Z what command line parameter ?

    Suggestion: /? (-?) and /help (-help) command-line arguments to show a list of all possible arguments in a small window. *Smile Help using Forfiles command :)
     
    Naki, Dec 3, 2020
    #2
  3. ryanly Win User
    GPU-Z what command line parameter ?

    Current /? (-?) or / help (-help) parameter is invalid
     
    ryanly, Dec 3, 2020
    #3
  4. Rohn007 Win User

    Help using Forfiles command

    Batch rename files using ForFiles command getting syntax error

    Win 10

    I want to rename a bunch of files to add a prefix. ie "aaa.url" to "win 10- aaa.url"

    I found these pages:

    Rename file extensions in bulk from command line [CMD]

    Forfiles

    the example and my version of the command

    forfiles /M *.jpg /C "cmd /c rename @file \"@fname - pic.jpg\""

    forfiles /M *.* /C "CMD /c RENAME @FILE \"WIN 10- @FILE\""

    I get this output:

    D:\Public\Favorites\@test>forfiles /M *.* /C "CMD /c RENAME @FILE \"WIN 10- @FILE\""

    The syntax of the command is incorrect.

    The syntax of the command is incorrect.

    The syntax of the command is incorrect.

    The syntax of the command is incorrect.

    The syntax of the command is incorrect.

    The syntax of the command is incorrect.

    The syntax of the command is incorrect.

    'Tutorials' is not recognized as an internal or external command,

    operable program or batch file.

    The syntax of the command is incorrect.

    The syntax of the command is incorrect.

    The syntax of the command is incorrect.

    The syntax of the command is incorrect.

    The syntax of the command is incorrect.

    As far as I can see I have the syntax OK, but obviously windows does not agree with me.

    What am I missing?
     
    Rohn007, Dec 3, 2020
    #4
Thema:

Help using Forfiles command

Loading...
  1. Help using Forfiles command - Similar Threads - Help using Forfiles

  2. Need help using ROUTE command please

    in Windows 10 Gaming
    Need help using ROUTE command please: Hi everyone,I need help setting up the ROUTE command on my system please.I am very happy with my WIFI connection. But unfortunately it does not work with WakeOnLAN. WOL will only work with my ethernet card.My computer is not in a position to run network cable to my router so...
  3. Need help using ROUTE command please

    in Windows 10 Software and Apps
    Need help using ROUTE command please: Hi everyone,I need help setting up the ROUTE command on my system please.I am very happy with my WIFI connection. But unfortunately it does not work with WakeOnLAN. WOL will only work with my ethernet card.My computer is not in a position to run network cable to my router so...
  4. Help : Data Lost By Using Diskpart Clean Command

    in Windows 10 Gaming
    Help : Data Lost By Using Diskpart Clean Command: By Installing Windows 11 from Windows 10 , To Make Space for Windows 11I have Entered the Command Diskpart Clean and Then convert the Diskpart to mbrAfter Installing Windows 11, I noticed That There was Only Local Disk C Which is Formatted or Cleared and Other Local Disks...
  5. How to schedule ForFiles command on Shared Network drive

    in Windows 10 News
    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...
  6. 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...
  7. Help with run command using the command prompt

    in Windows 10 Customization
    Help with run command using the command prompt: Hello, I have a question regarding running a batch file using a command prompt. My batch file is in my directory. I change directory to where my batch file is located at , and run the batch file as shown in my example. But I got an error saying a run is not recognized...
  8. Forfiles Error Invalid Agrument

    in Windows 10 Customization
    Forfiles Error Invalid Agrument: Not sure why return error Invalid Agrument Some one can see the issue. Thank you. forfiles /p C:\Program Files\MicrosoftSQLServer\MSSQL15.SQL\MSSQL\Backup\ -s -m *.bak /D -2 /C "cmd /c del /q @path"...
  9. 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?...
  10. DOS CMDs - For and Forfiles to rename files

    in Windows 10 Support
    DOS CMDs - For and Forfiles to rename files: I have just bought a Surface 4 Pro with k'brd. I find that one old program will no longer run correctly, so need to make a Batch file to replace it. Windows 10 screen capture produces files all with the same name, appending a serial number. Capture.exe produces a .bmp...