# Sorting Files

Javinizer's primary function is to sort your local JAV media files into an ordered format to use within a media library. It is likely that you will want to read the settings documentation to make changes before sorting.  The commandline parameters are as follows:

```
Javinizer [[-Path] <String>] [[-DestinationPath] <String>] [-Recurse] 
[-Depth <Int32>] [-Url <Array>] [-SettingsPath <FileInfo>] [-Strict] 
[-MoveToFolder <Boolean>] [-RenameFile <Boolean>] [-Force] [-HideProgress]
[-Update] [-IsThread] [-Set <Hashtable>] [<CommonParameters>]
```

## Sorting a path of files

This will most likely be your go-to command when running Javinizer. This utilizes the `-Path`, `-DestinationPath`, and optionally the `-Recurse` command.

By default, Javinizer will assign the `-Path` and `-DestinationPath` via your settings.

* Path  -> `location.input`
* DestinationPath -> `location.output`

```
# Path is location.input
# DestinationPath is location.output
C:\> Javinizer
```

If  `-DestinationPath` is not assigned via the commandline or the `location.output` setting, then the `-DestinationPath` will automatically be assigned to the same location as your `-Path`.

```
# Path is C:\JAV\Unsorted
# DestinationPath is C:\JAV\Unsorted
C:\> Javinizer -Path 'C:\JAV\Unsorted'
```

Otherwise, you can just set both `-Path` and `-DestinationPath` on the commandline.

```
C:\> Javinizer -Path 'C:\JAV\Unsorted' -DestinationPath 'C:\JAV\Sorted'
```

## Movies not being matched

### Using direct URLs

If for whatever reason Javinizer is unable to find a movie via the ID on a scraper, you can use the URLs the sort the file. The URLs will need to be defined as an array.

```
# The -Path needs to be the FULL PATH to the file, not a directory
C:\> $Urls = @('http://www.javlibrary.com/en/?v=javlilb54i', 'https://www.r18.com/videos/vod/movies/detail/-/id=118abp00420/')
C:\> Javinizer -Path 'C:\JAV\Unsorted\ABP-420.mp4' -Url $Urls
```

### Using -Strict

If a file is not being matched, it may be because the default file matcher is incorrectly matching your filename to the scraper source ID. View the documentation in the "File Matching" article to see how the `-Strict` parameter can be used to directly match the filename as the ID.

```
C:\> Javinizer -Path 'C:\JAV\Unsorted' -Strict
```

{% content-ref url="../file-matching" %}
[file-matching](https://jvlflame.gitbook.io/javinizer/master/using-javinizer/file-matching)
{% endcontent-ref %}

## Updating already-sorted files

If you want to update metadata for already-sorted files, you can use the `-Update` parameter. The `-Update` parameter will not move any of your movie files, and only replace the `.nfo` metadata file by default.

```
C:\> Javinizer -Path 'C:\JAV\Sorted' -Recurse -Update

# Using the -Force parameter will also replace all image files
C:\> Javinizer -Path 'C:\JAV\Sorted' -Recurse -Update -Force
```
