Description of how to use Commerce Server Staging (CSS) project filters at a command prompt (921487)



The information in this article applies to:

  • Microsoft Commerce Server 2007 Developer Edition
  • Microsoft Commerce Server 2007 Enterprise Edition
  • Microsoft Commerce Server 2007 Standard Edition

INTRODUCTION

You can use command-line options for Commerce Server Staging (CSS) to automate the content replication process. You can also use a filter switch at a command prompt when you add a CSS project in Microsoft Commerce Server 2007. This article describes how to use CSS project filters at a command prompt.

MORE INFORMATION

Syntax for including filters when you add a CSS project by using the css addproj command

To add a CSS project from a command line by using filters, type the following command:

css addproj projectname sourcedirectory [destination1 | route1] [...] [/filter filters] [globalflags]

Note The globalflags variable includes the following switches:
  • /server servername
  • /user username [pass | *]
Filter switches have the following options.
SwitchOption
+filterIncludes a file filter or a directory filter
-filterExcludes a file filter or a directory filter
\Applies a filter to directories
...\Applies a filter to all subdirectories
filterA file filter or a directory filter that can use wildcard characters
The following is an example of a filter that has switches:

/filter "+text1.txt -*.exe -directory1\ +...\*.jpg"

This filter does the following:
  • Includes the Text1.txt file
  • Excludes all files that end in .exe that exist in the project root directory
  • Excludes the Directory1 directory
  • Includes all *.jpg files in all the directory trees

Syntax for including more than one directory in a filter

To include more than one directory in a filter, type the following command:

css addproj projectname c:\sourcedirectory c:\destinationdirectory /filter "-directory1\ +directory2\ "

Note Make sure that there is a space character after the last backslash (\) and before the closing quotation marks.

You can also use wildcard characters in directory names. For example, you can exclude the _vti_* directories that are installed with FrontPage Server Extensions from Microsoft. Additionally, you can include all directories that have names that start with myWeb, such as myWeb01. To do this, type the following command:

css addproj projectname c:\sourcedirectory c:\destinationdirectory /filter "-_vti*\ +myweb*\ "

Syntax for file names and for directory names that have space characters

Space characters in a file name or in a directory name may cause problems in the command line syntax for CSS project filters. To work around these problems, you can use wildcard characters to bypass the space character in the name. For example, you can exclude a subdirectory under the replication root directory that is named My Folder. To do this, type the following command:

css addproj projectname c:\sourcedirectory c:\destinationdirectory /filter "-my*\ "


Modification Type:MajorLast Reviewed:7/25/2006
Keywords:kbhowto kbinfo KB921487 kbAudDeveloper