# Command Line

If you start Flash Renamer from a command prompt or .bat script you may give a number of arguments. This allows you to automate Flash Renamer in various ways.

If no command line switches are used, Flash Renamer will treat the command line as a list of files and try to load them into free select mode:

`FlashRen.exe "c:\myfile.txt" "d:\a folder\another file.txt"`

This allows you to for example put a shortcut to Flash Renamer on the send to menu in Windows Explorer. (Note however, that command lines in Windows are limited in size. If you send a lot of files to Flash Renamer this way, it may not work and you will instead get a very cryptical message. The number of files you can send depend on the number of characters in the filenames path included.)

It is also possible to simply give a folder to start Flash Renamer in:

`FlashRen.exe "d:\a folder\"`

Command line switches

Using command line switches you can tell Flash Renamer to load files and then run one of your presets on this path. The following command line switches can be used:

- `/p` - Sets the startup path for Flash Renamer. If you include anything else than a valid folder at the end (e.g. "*.mp3") this will be loaded as the file pattern.

- `/l` - Allows you to specify a text file containing files and folders (full paths, one file or folder per line). The files and folders will be loaded into the Free Select mode.

- `/r` - The name of the Preset you want to execute. You must type the full name, including spaces.

- `/f` - Include files. (only when using `/p`)

- `/d` - Include folders. (only when using `/p`)

- `/s` - Include subfolders. (only when using `/p`)

- `/k` - If the `/l` switch was used, this switch will instruct Flash Renamer to delete the "`/l` file" after it has been read.

- `/x` - Normally when you automate Flash Renamer it will automatically close when it has finished renaming. Use this switch to prevent that happening.

Problem: Each night you computer downloads a bunch of files, but they all have nasty looking filenames! Solution: First create a preset that makes your filenames look good. Let's call it my preset. Then use the Windows Task Scheduler to launch Flash Renamer every moring with the following command line: `FlashRen.exe /p c:\download\*.* /r "my preset" /f`

Notes:

- If your path, preset name, or filename contains spaces, you must encapsulate the string using quotes, like this: "example name"

- If you don't specify neither the `/f` switch nor the `/d` switch, Flash Renamer will use the last used settings.

- If you specify both a path (`/p`) and a file list (`/l`), the file list will take precedence.

- If you don't include a preset (`/r`), Flash Renamer will start as normal and then load the specified path (`/p`) or file list (`/l`).

- The command line switches use a normal "slash" (`/`), as opposed to paths in Windows that use the "backslash" (`\`). Don't confuse these two!