Command line mode (silent run parameters)

Previous Top Next


You can start ReplaceMagic also from command line with pre-configured configuration file. This is practical if you want to automate your document migration like, for example, having tools use to move files from one to other location and after that you want automatically to fix links according to migration details. 


To help with configuration file preparation we introduced option to automatically create XML configuration.


To enable creation of config file from ReplaceMagic in Search&Replace form you can click on "Silent run params" button which will open new form where you will see XML structure containing all options that you set for ReplaceMagic run.




To have full list of parameters prepare everything like that you want to run search&replace:

  1. select location where documents are (Scan Documents) 
  2. enter search&replace strings in Search&Replace form
  3. select areas where changes should be done
  4. run Silent run parameters and copy and paste content of that form to your config file
  5. start application with ReplaceMagic ConfigFile1.xml
  6. as we support start with multiple configuration files you can create them all (of course, you can do that also manually or from any tool that you are using to move files) and then start application with "ReplaceMagic ConfigFile1.xml ConfigFile2xml ... ConfigFileX.xml". It is important to have just SPACE between configuratino files. 


Parameters:


  • Full docs scan - by setting this parameter ReplaceMagic will scan content of files, otherwise documents will be only listed for replacement process
  • Encrypt connect data - if this parameter is set ReplaceMagic will encrypt username and password used to connect to SharePoint to reduce risk if somebody has access to configuration file as everything else will be saved in plain text. User names and passwords may contain non-English characters (for example č, ž, ä, é, €); since version 2026.2.4.3 they are encrypted completely. If an XML file was created with an older version and the user name or password contains such characters, generate the XML file again.
  • Export results - after silent run is done ReplaceMagic will export content of all tabs to Excel files. Files should be stored in C:\Users\Your_User\AppData\Roaming\ReplaceMagic under name of config filename plus "_ScanDocuments_TIMESTAMP.xlsx" and "_SearchAndReplace_TIMESTAMP.xlsx". In case that there are skipped documents after scanning on SharePoint, they will be also exported (filename format: SkippedFilesExport_COMANDLINEFILENAME_TIMESTAMP.csv and SP_SkippedFilesExport_COMANDLINEFILENAME_TIMESTAMP.csv)
  • Save results in database - this option is still work-in-progress but will allow that save of processing result is saved in database for later usage. Important is that database connection has to work as otherwise saving will not work
  • Send results on email - processing results are sent on email configured over Configuration - Notifications
  • Show notification popup on processing completion - by setting this popup ReplaceMagic will show notification popup to highlight that processing is completed (in additional to this notification in progress bar)
  • Close ReplaceMagic on completion - by setting this parameter, ReplaceMagic will be automatically closed after last XML file is processed as long as in that file you have this parameter. To be on the safe side, if you have multiple XML files, set this parameter in all of them.
  • Use SmartMapper - when selected this will allow silent parameters run to use SmartMapper prepared search & replace keys for automated processing. After checking Use SmartMapper, you will need to select SmartMapper runID from drop-down. Keep in mind that SmartMapper can be selected only if there are no entered search & replace keys in Search & Replace form. With SmartMapper active, ReplaceMagic will save processing results into database (this is must configuration)
  • Documents (with Use SmartMapper) - which documents are processed: All documents, Only documents with links or Only documents with SmartMapper keys (the same choice as when a run is imported and on the last page of the SmartMapper wizard). Saved as <SMARTMAPPERDOCUMENTS>All</SMARTMAPPERDOCUMENTS>, WithLinks or WithKeys. WithKeys keeps the scanned documents whose path matches a key of the selected run - also at the target location given by the mapping rules; WithLinks keeps the documents in which the run's own scan found links. If nothing matches, all documents are processed and this is written to the log; a silent run never shows a message.


Several SharePoint sites in the configuration file

If several SharePoint sites are in the SharePoint Selection form, the generated XML file contains the main site in the usual tags (SHAREPOINTURL, SHAREPOINTUSERNAME, SHAREPOINTPASSWORD, SHAREPOINTCONNECTIONTYPE, ...) and every additional site in its own block:

<SHAREPOINTCONNECTIONS>

  <SHAREPOINTCONNECTION>

    <SITEURL>https://contoso.sharepoint.com/sites/projects</SITEURL>

    <SITEUSERNAME>user@contoso.com</SITEUSERNAME>

    <SITEPASSWORD>...</SITEPASSWORD>

    <SITECONNECTIONTYPE>1</SITECONNECTIONTYPE>

    <SITECLAIMSDOMAIN></SITECLAIMSDOMAIN> <SITECLAIMSSTS></SITECLAIMSSTS> <SITECLAIMSIDPLD></SITECLAIMSIDPLD>

    <SITEPROXYURL></SITEPROXYURL> <SITEPROXYPORT></SITEPROXYPORT>

    <SITEPROXYUSERNAME></SITEPROXYUSERNAME> <SITEPROXYPASSWORD></SITEPROXYPASSWORD>

    <SITEUSEMIP>False</SITEUSEMIP> <SITEMIPAPPLICATIONID></SITEMIPAPPLICATIONID> <SITEMIPTENANTID></SITEMIPTENANTID>

    <SITEMIPIDENTITYEMAILID></SITEMIPIDENTITYEMAILID> <SITEMIPMULTITENANT>False</SITEMIPMULTITENANT>

    <SITEAPPONLYAPPLICATIONID></SITEAPPONLYAPPLICATIONID> <SITEAPPONLYTENANTID></SITEAPPONLYTENANTID>

    <SITEAPPONLYCERTIFICATEPATH></SITEAPPONLYCERTIFICATEPATH> <SITEAPPONLYCERTIFICATEPASSWORD></SITEAPPONLYCERTIFICATEPASSWORD>

  </SHAREPOINTCONNECTION>

</SHAREPOINTCONNECTIONS>

  • SITECONNECTIONTYPE uses the same numbers as SHAREPOINTCONNECTIONTYPE.
  • SITECONNECTIONTYPE is required for every additional site; if it is missing or not a number, the site is not connected (this is written to the log) and its locations are skipped.
  • Every SHAREPOINTLOCATION has a ROOT - the address of the site it belongs to (as in the SharePoint Selection form).
  • With Encrypt connect data also SITEUSERNAME and SITEPASSWORD are encrypted.
  • If an additional site cannot be connected, ReplaceMagic writes this to the log and skips only the locations of that site; the other sites are processed. In silent runs ReplaceMagic also reads the SharePoint time zone of every site.
  • Configuration files without <SHAREPOINTCONNECTIONS> work as before (one site).
  • The proxy settings of the main site are used for all sites.


To have complete file set all options how you need them for normal search&replace process and generate this file which you can use afterwards to start ReplaceMagic from command prompt or to generate with any other tool XML file in ReplaceMagic readable format.


This option is frequently used for automation of document migration process.


Since version 2026.3.0.0 (and pre-release from 2026.2.4.3) the user name and password are encrypted both with Copy to clipboard and with Save; XML files created with Encrypt connect data in earlier versions may contain them as plain text and should be created again. If the XML file contains two <SHAREPOINTCONNECTION> blocks of the same site collection (or a block of the main site's site collection), the extra block is not connected (this is written to the log) and its locations are processed through the site that is already connected.