# fetchfiles Options

fetchfiles
   -d datasource
   -u username
   -p password
   -w workingdirectory
   [-i  inputfile]
   [-v]
   [-n | -r | -f]
   [path]…

The name of the datasource is given with -d. The caching server must be configured to route this datasource. The fetchfiles utility logs into the datasource with username given with -u and password given with -p. The -w switch is mandatory, and is used to specify the working directory to download the files to (do not use your normal ProjectWise user working directory for this). Once the downloaded files are cached, they will be deleted from the working directory. -v (verbose) is optional and is for monitoring what the fetchfiles utility is doing.

Paths should be specified in the form \aaa\bbb\ccc. If you want the fetchfiles utility to recurse the specified folder (that is, to look for files in subfolders of the specified folder), then enter the -r option before entering the path. If you do not want to recurse the specified folder, enter -n before entering the path (if no option is entered, -n is assumed by default). Entering the -f option before entering the path tells the fetchfiles utiltiy to treat the specified path as a document instead of a folder. Examples:

—r \path\to\recursed\folder

(this will fetch all files of the root of the specified folder, as well as all files in subfolders of the specified folder)

	-n \some\path\

(this will only fetch the files at the root of the specified folder)

-f \path\to\file.ext

(this will only fetch the specified file)

With the -i option, an input file can be specified for fetchfiles. All the same options can be used in an input file, separated by new lines. An example contents of a input file is:

-d shaup123:pwdatasource
-u admin
-p admin
-w c:\fetchfilesworkdir
\foo2
-f \foo\bar\sample.pdf
-n \non\recursed\folder

Note: When specifying the path to a file or folder in ProjectWise, the path you enter is case-sensitive when the datasource you are fetching from is using an Oracle database.