If you need to create backup copies of 1C and client-server and file IS, it is most convenient to use the command Windows string. Using the technology described below, you will have all the databases in the native 1C .dt format, which will allow you to:

  • change the file version to client-server and vice versa;
  • transfer databases to other servers or computers;
  • unify the format backups 1C.

All activities require a computer Windows control 2003+ with installed thick client from technology platform delivery. We will upload to network drive, located on a NAS device that acts as a 1C backup storage, and not only.

Launching the 1C configurator from the command line

For convenience, let's create a .cmd file, which is a set of lines that launch the 1C configurator from command line. An example file can be downloaded. This file can be used in the future in the regular Windows Scheduler located in the Control Panel to automate the process Reserve copy.

The basis of the solution can be the following 1C command line, which backs up the client-server database:

"C:\Program Files (x86)\1cv8\common\1cestart.exe" CONFIG /S"Server\buh" /N"Administrator" /P"MyPassword" /Out"C:\1c.log" /DumpIB"\ \backup\1c\buh_%date%.dt"

Here, in order not to depend on the version, we run 1cestart.exe with the following parameters:
CONFIG - launching the 1C configurator from the command line
/S - specify the client-server IB buh, hosted in the Server cluster
/N "Administrator" - username as it is specified in the list of users.
/P"MyPassword" - password for the previously specified user. If there is no password, then this parameter does not need to be specified to start 1C from the command line.
/Out"C:\1c.log" - the name of the file that will contain service information about the progress of the script, as well as errors and diagnostic messages.
/DumpIB”\\backup\1c\buh_%date%.dt” - and finally, the key that unloads the database to the network drive \\backup to the 1c folder with the name buh_XX.XX.XXXX.dt, where XX.XX.XXXX - The current date to prevent overwriting backup files and identify them.

Please note that when writing Russian characters in the .cmd file that performs 1C backup from the command line, you must use the CP866 encoding, and not the standard Windows CP1251! You should also pay attention to double quotes, framing parameter values ​​and no spaces between parameters and their values.

For file IBs, instead of the /S key, the /F parameter should be specified, otherwise the syntax for launching 1C from the command line will be identical, for example:

"C:\Program Files (x86)\1cv8\common\1cestart.exe" CONFIG /F"D:\1C_Bases\buh" /N"Admin" /P"MyPassword" /Out"C:\1c.log" / DumpIB"\\backup\1c\buh_%date%.dt"

For a more detailed description of all 1C launch options, refer to the current developer documentation. Our experts are also ready to develop a backup system for your needs on a commercial basis. The cost of implementation is only 5000 rubles.

In this article I will tell you about 1C launch options and how to apply them. Here are some examples of how to use these options. After reading the article, you will be able to automate some daily processes.

When starting 1C:Enterprise, you can use the launch options that can be specified in the settings or in the shortcut that you use to launch 1C.

Launch mode 1C

CONFIG- 1C will start in the Configurator mode.
ENTERPRISE- 1C will start in Enterprise mode.

1cestart.exe- a file for launching the 1C program, usually located in the "1cv8 \ common" folder. Automatically detects on startup desired version client. When installing 1C, shortcuts on the desktop and in the Start menu refer to this particular file.

1C launch options for automatic user selection

  • /N"Username"
  • /P"User Password"

The username and password must match the username and password specified in the user list in the Configurator. Users can be viewed in the Configurator, go to top menu: Administration > Users. If the password is empty, then this field can be omitted.

These parameters can be specified in the settings when editing a database in the list of databases. In field " Extra options launch".

Run 1C and go to settings information base, the following window should appear:

Write down the parameters as shown in the figure, specifying your username and password, then click "Finish". If everything is done correctly, then when you enter this database, you will not be asked for a username and password.

1C launch options for automatic launch of the database

  • /F "address" - address to the database, if it is stored in the file version.

If your database is stored on the server, you need to set the launch parameters differently:

  • /S "address" - specify the address as follows: "Name of the server (of the infobase cluster)" \ "Name of the infobase on the server"

These parameters must be written in the shortcut with which you launch 1C:Enterprise. Go to the properties of the shortcut, at the end of the "Object" field, add the parameters you need.

If everything is done correctly, when you start the shortcut, the database that you specified in the parameters should start.

For convenience, you can create a new shortcut, or copy the one you use.

Autoload 1C at system startup

If you want to start 1C Enterprise at system startup with the necessary parameters, you need to copy the 1C shortcut to the Startup folder.

If it contains 1C startup parameters, they will work when the system starts.

You can combine any launch parameters 1C. To do this, simply write down the necessary parameters in the 1C settings or in the shortcut.

Additional launch options 1C

  • /LogUI- recording user actions in the log. (Writing will be done in the user's directory, in a file called "logi.txt")
  • /DumpIB " Upload file address « - unloading the database. Suitable for creating automatic database archiving.
  • /execute " Address external processing» - the parameter is intended for automatic start of external processing after system startup.
  • /C"String parameter" - passes the parameter to the configuration. You can access it through the global context in the Startup Parameter configurator.
  • /DisableStartupMessages- the parameter removes system messages when starting 1C Enterprise.

When editing an infobase. You can specify the version of 1C through which to launch (suitable if you have several databases installed running under different versions client)

An example of using parameters for automatic infobase archiving.

"C:\Program Files (x86)\1cv8\common\1cestart.exe" CONFIG /F"C:\Base_Buh" /N"user" /P"111" /DisableStartupMessages /DumpIB C:\Arhiv\Buh.dt / Out" C:\Arhiv\log_arhiv.txt" -NoTruncate

If you register these parameters in the shortcut for launching 1C in the "Object" field, an archive of the base will be made, which is located "C:\Base_Buh" in the "C:\Arhiv" folder under the name "Buh.dt". It will also write to the log file "C:\Arhiv\log_arhiv.txt". Specify your paths, where the database is located, and where you want to create archives.

Setting Application Debugging Launch Options

When developing applications, it is often necessary to run the 1C debugger under user defined, for this you need to go to the configurator: Help > Options

On the "Launch 1C:Enterprise" tab in the "User" group, the current user is set by default (under which you entered the configurator). You can change it to whatever you need. And debugging will start under the selected user.

Also, here you can specify under which client to run the application.

Here are some easy steps you can take useful features in the 1C:Enterprise program.

Platforms: 1C:Enterprise 8.3, 1C:Enterprise 8.2, 1C:Enterprise 8.1
Configurations: All configurations

2012-11-16
21364

As you know, clients do not give the opportunity to select the base. They are launched by specifying special parameters on the command line. You can also create a “.bat” file and write in it a direct launch of 1C with the necessary parameters. It is a plain text file with the extension ".txt" replaced with ".bat". Consider these parameters 1C. Using the parameters, you can run the 1C program without any extra effort. Besides this option very fast.

This launch method is extremely convenient when there is a need to constantly launch several copies of the 1C program on behalf of various users. This need often arises when testing a single database. In this state of affairs, without creating the appropriate ".bat" file, the startup procedure will be very inconvenient and lengthy.

Consider some 1C parameters that may be useful to you when working: for network 1C, file 1C and new (thin client).

Starting a database that is already in the list of databases - parameters:

C:\Program Files\1cv82\common\1cestart.exe ENTERPRISE /IBName"BaseName in the List" /NUser /PPassword

In this case, the 1C starter is launched. Mode - "enterprise", the name of the target database is already in the list of 1C databases.

Run directly (file option) without entering user and password

C:\Program Files\1cv82\8.2.13.205\bin\1cv8.exe ENTERPRISE /F"C:\Base1" /NUser /PPassword

Here a thick client is launched with a direct path to the database directory. It doesn't matter if the target base is on the list. Mode - "Enterprise".

Direct launch (network option) without entering a user and password

C:\Program Files\1cv82\8.2.13.205\bin\1cv8.exe ENTERPRISE /S"ServerComputerName\BaseNameOnServer1C" /NUser /PPassword

The same story as in the previous paragraph, only for the network version of 1C.

Running the configuration for the thin client "Trade Management" in thick client mode

C:\Program Files\1cv82\8.2.13.205\bin\1cv8.exe ENTERPRISE /RunModeOrdinaryApplication

Starting external processing directly at the start of 1C

C:\Program Files\1cv82\8.2.13.205\bin\1cv8.exe ENTERPRISE /Execute"FullPathToProcessFile.epf"

Download database to file

File Version: C:\Program Files\1cv81\bin\1cv8.exe" config /F"C:\bases1c\BUH\Titan" /N"Admin" /DumpIB "C:\Buh_Titan_%date%.dt

Server Version: C:\Program Files\1cv81\bin\1cv8.exe" config /S"Server\AtlantBuh" /N"Admin" /DumpIB "C:\Buh_Titan_%date%.dt

Command line options to specify launch options

/@<имя файла>
Path to a file with command line options.

/F<Путь>
path to the file infobase (excluding the file name).

/S<Адрес>
the address of the infobase stored on the 1C:Enterprise 8.x server is added up as follows:

<Имя компьютера, работающего сервером приложений> \ <Ссылочное имя информационной базы, известное в рамках сервера 1С:Предприятия 8.x>

/N<Имя>
Username. Must be specified in the same way as in the Configurator

/P<Пароль>
the password of the user whose name is specified in the /N option. Is an optional parameter

/WA-
prohibiting the use of Windows authentication at the start of the Enterprise or the Configurator

/WA+
setting the mandatory use of Windows authentication at the start of 1C:Enterprise or Configurator. If the /WA switch is not specified, it is assumed that the /WA+ command line option is used.

/AU-
prohibition of the output of the question about the update current version 1C:Enterprise with administrative installation

/AU+
setting the output of the question about updating the current version of 1C:Enterprise from the administrative installation. If the /AU switch is not specified, it is assumed that the /AU+ command line option is used.

/Out<Имя файла>[-NoTruncate]
setting a file for displaying service messages. If the NoTruncate key is set (separated by a space), the file is not cleared

/L<Каталог>
the directory of localized interface resources is specified (for example, "RU")

/DisableStartupMessages
Suppresses startup messages: “Database configuration does not match saved configuration. Proceed?"; “The capabilities of your computer are not enough to edit the configuration help. To edit help, you need to install Microsoft Internet Explorer version 6.0 or higher."; “The capabilities of your computer are not enough to edit html documents, including help sections. To edit html documents, you need to install Microsoft Internet Explorer version 6.0 or higher. In this launch, editing html documents will not be available.

/C<Строка текста>
passing parameter to configuration

Not used for basic versions:
UC<Код доступа>
Establishing a connection to an infobase that is blocked from establishing connections. If a non-empty access code is specified when establishing a lock, then to establish a connection, you must specify this code in the /UC parameter.

/RunShortcut<имя файла>
launching the 1C:Enterprise 8.1 system with a list of infobases obtained using the specified file. The file can be a list file of common infobases (*.v8i), or an infobase shortcut file (*.v8l).

/IBConnectionString
setting the connection string with the entire infobase, in the form in which it is returned by the InfobaseConnectionString() function. Parts of the connection string can be overridden by pre-existing options. This requires /IBConnectionString to be on the command line before them. When passing a connection string as a command line parameter, remember that the connection string contains quotes. Therefore, it is required to put the entire string in quotes, and double the quotes contained inside.

/SLev
security level of the client connection with the 1C:Enterprise server. /SLev0 - insecure connection; /SLev1 - secure connection only during authentication; /SLev2 - secure connection for the entire session. If the parameter is not specified, then it is equivalent to /SLev0.

debug
indicates that 1C:Enterprise is launched in debug mode.

/DebuggerURL
identification of the debugger to which the application should connect immediately after launch. Specifies the debugger URL (protocol, computer, and port number) on which the debugger can create remote objects.

/SAOnRestart
prompt for a password when restarting the system from this session. By default, no password is requested.

/execute<имя файла внешней обработки >
is designed to start external processing in 1C:Enterprise mode immediately after the system starts.

/logui
designed to run a client application to be created on the user's computer in the application files folder %APPDATA%\1C\1Cv81\<Уникальный идентификатор ИБ>\logui.txt" file logui.txt, which will record all interactive user actions (keystrokes, mouse clicks).

/SchJobDn
manages the execution of scheduled jobs. Possible meaning"Y" or "N". "Y" - the created infobase will be prohibited from performing scheduled tasks.

Configurator Batch Mode Command Line Options

/DumpIB<Имя файла>
unloading infobase in command mode

/RestoreIB<Имя файла>
loading infobase in command mode

/DumpCfg<имя cf файла>
saving the configuration to a file

/LoadCfg<имя cf файла>

/UpdateDBCfg[-WarningsAsErrors]

updating the database configuration. If the WarningsAsErrors key is specified (separated by a space), then all warning messages will be treated as errors
/DumpDBCfg<имя cf файла>
saving the database configuration to a file

/RollbackCfg
back to database configuration

/CheckModules
perform syntax check

/UpdateCfg<имя_файла>
updating a supported configuration. Filename is the name of the .cf or .cfu file.

/IBCheckAndRepair [-ReIndex]
[-LogIntergrity] [-RecalcTotals]
[-IBCompression]
[-TestOnly | [-BadRefCreate |
-BadRefClear | -BadRefNone]
[-BadDataCreate |
-BadDataDelete] ]

perform testing and correction of the infobase

Often, when working with 1C, it may be necessary to carry out some of the same type of operations that are repeated systematically in time and simply distract from the main work. These can be various uploads and downloads, the formation of some kind of data for external analysis, etc. There is a fairly simple way to automate these operations and actually forget about them, periodically receiving log files by mail for control.

It's great if these operations are already written by external processing, it's not a problem, if this is not the case, create and transfer everything there. Further, to check the performance, I recommend testing all this in manual mode and then, if everything works as it should, rewrite the main processing code in such a way that when external processing is loaded, it starts automatically, without pressing the execute button and the like. The simplest thing is to move the code into a procedure OnOpen().

The next step is to automatically close the program after performing the external processing that we have created and it is already working for us. To do this, in the procedure OnOpen() at the very end, insert the following command: ShutdownSystem(False); in this case the parameter Request Opportunity we pass the value "False" in order to cut off various options for additional questions of the system when closing, thereby initiating an unconditional shutdown of 1C after performing this external processing. To be sure, we run the program again and perform processing and make sure that it worked and the program closed itself.

"C:\Program Files (x86)\1cv8\8.3.5.хххх\bin\1cv8.exe" ENTERPRISE /DisableStartupMessages /FC:\base path /N"UserName" /P"UserPassword" /Execute c:\path to processing\self-processing.epf

Let's decipher:

1. "C:\Program Files (x86)\1cv8\8.3.5.хххх\bin\1cv8.exe" ENTERPRISE - the 1C engine itself in this case is 8.3, check the path with yourself, it differs depending on the version and engine including do not forget to edit it after updating the latter.

2. / DisableStartupMessages - disable all messages at system startup.

4. /N "Username" /P"UserPassword" - respectively /N username, also immediately without a space and /P password.

5. /Execute c:\processing path\self-processing.epf - /Execute starts our processing, the path and name must follow this key.

Now everything, it remains only to add to the task scheduler our cmd file: autostart1c.cmd, specifying the schedule for its launch.

To monitor the work of external processing, I recommend creating a separate user for it, even better, so that the processing itself creates a log file, which also periodically falls to your mail.

These are not tricky tools that help automate everyday routine operations, good luck to you!

Mode selection command line options:

CONFIG
launching the 1C:Enterprise 8 system in the "Configurator" mode

ENTERPRISE
launching 1C:Enterprise 8 in 1C:Enterprise mode

CREATEINFOBASE
creating distribution and update files


a string specifying the infobase parameters, each of which is a fragment of the view
,
where Parameter name is the name of the parameter, and Value is its value. Fragments are separated from each other by ";". If the value contains whitespace characters, it must be enclosed in double quotes (").

File mode options

File directory of the infobase;
Locale language (country) that will be used when creating the infobase. Valid values the same as the parameter of the Format method. The Locale parameter is optional. If not specified, the regional settings of the current infobase will be used.

Client-Server Options

Srvr server name 1C:Enterprise;
Ref is the name of the infobase on the server;
SQLSrvr name of the SQL server;
SQLDB name SQL databases data;
SQLUID SQL username;
SQLPwd SQL user password. If the password for the SQL user is not set, then this parameter can be omitted
SQLYOffs is the date offset used to store dates in SQL Server. It can take the values ​​0 or 2000. This parameter is optional. If not set, the value is 0.
Locale - language (country), (similar to the file version).

For all options, the parameters are defined:

Usr Username;
pwd password

/AddInList parameter showing under which name to add the base to the list, if not specified, the base will not be added to the list. If no name is specified, the default is used, similar to interactive creation information base.
Simultaneous use of keys is not allowed.

Command line options to specify launch options:

/@
command line options are written in the specified file

/F
path to the infobase, if it is stored in a file (no need to specify the file name)

/S
the address of the infobase stored on the 1C:Enterprise 8 server is added up as follows:

/N
Username. Must be specified in the same way as in the list of users created in the Configurator

/P
the password of the user whose name is specified in the /N option. If the user does not have a password, this parameter can be omitted

/WA-
prohibiting the use of Windows authentication at the start of the Enterprise or the Configurator

/WA+
setting the mandatory use of Windows authentication at the start of 1C:Enterprise or Configurator. If the /WA switch is not specified, it is assumed that the /WA+ command line option is used.

/AU-
prohibition of displaying a question about updating the current version of 1C: Enterprise from an administrative installation

/AU+
setting the output of the question about updating the current version of 1C:Enterprise from the administrative installation. If the /AU switch is not specified, it is assumed that the /AU+ command line option is used.

/Out
[-NoTruncate]
setting a file for displaying service messages. If the NoTruncate key is set (separated by a space), the file is not cleared

/L
the directory of localized interface resources is specified (for example, "RU")

/DisableStartupMessages
Suppresses startup messages: “Database configuration does not match saved configuration. Proceed?"; “The capabilities of your computer are not enough to edit the configuration help. You must have Microsoft Internet Explorer version 6.0 or later installed to edit the Help.»; “The capabilities of your computer are not enough to edit html documents, including help sections. To edit html documents, you need to install Microsoft Internet Explorer version 6.0 or higher. In this launch, editing html documents will not be available.

/C
passing parameter to configuration

Batch mode

Using command line options, the administrator can run the configurator in batch mode to perform the following actions:

  • updating the database configuration, including the one under support;
  • performance of syntactic control;
  • testing and correcting the infobase with setting all parameters;
  • reduction of the registration log;
  • performing a configuration check.
  • Using command line options, the administrator can specify:

    • launching the 1C:Enterprise 8 system in the Configurator mode;
    • infobase parameters: user, password; for the file version - directory, language; for the client-server version - server name, infobase name, SQL server name, SQL database name, SQL username and password, date offset.

    In addition, all launch options can be generated in an external file whose name is specified in the command line options.

    After performing the actions specified in the launch parameters, the 1C:Enterprise configurator closes.

    Using the batch launch mode of the configurator allows you to automate the process of maintaining infobases by launching the corresponding batch files Scheduled.

    Configurator batch mode command line options:

    /DumpIB
    unloading infobase in command mode

    /DumpCfg
    saving the configuration to a file

    /UpdateDBCfg
    [-WarningsAsErrors]
    updating the database configuration. If the Warnings-AsErrors key is specified (separated by a space), then all warning messages will be treated as errors

    /DumpDBCfg
    saving the database configuration to a file

    /RollbackCfg
    back to database configuration

    /CheckModules
    perform syntax check

    /UpdateCfg
    updating a supported configuration

    /IBCheckAndRepair [-ReIndex]
    [-LogIntergrity] [-RecalcTotals]
    [-IBCompression]
    [-TestOnly | [-BadRefCreate |
    -BadRefClear | -BadRefNone]
    [-BadDataCreate |
    -BadDataDelete] ]
    perform testing and correction of the infobase

    ReIndex
    table reindexing

    LogIntergrity
    logical integrity check

    RecalcTotals
    recalculation

    IBCompression
    table compression

    TestOnly
    only testing if there are references to non-existent objects:

    BadRefCreate
    create objects

    BadRefClear
    clear objects

    BadRefNone
    do not change

    With partial loss of objects:

    BadDataCreate
    create objects

    BadDataDelete
    delete objects

    Simultaneous use of keys within a parameter subgroup is not allowed. Return code 0 if command succeeds, return code 1 otherwise (101 if there are errors in the data).

    Command line options for creating distribution and update files in batch mode:

    /CreateDistributionFiles
    [-cffile]
    [-cfufile
    [-f |-v ]+]
    Creating Delivery and Update Files

    cffile
    an instruction to create a distribution

    cfufile
    an instruction to create an update

    F
    the distribution included in the update is specified by the name

    V]
    the distribution included in the update is specified by the version

    Note: The -f |-v group of options is repeated as many times as the number of distribution files included in the update.

    Command line parameters for working with the configuration repository:

    /DepotF
    storage directory

    /DepotN
    vault username

    /DepotP
    vault user password

    V
    v - version number, if the version number is not specified, or equal to -1, it will be saved latest version.

    /DepotUpdateCfg [-v ] [-revised]
    Update storage configuration from file (batch mode)

    V
    version number, if the version number is not specified, or equal to -1, the latest version will be saved, if the configuration is connected to the repository, then the parameter is ignored

    Revised
    receive captured objects if required. If the configuration is not connected to the repository, then the parameter is ignored.

    Command line parameters for batch registration of 1C:Enterprise 8 as an Automation server:

    /RegServer
    application registration

    /UnregServer
    deleting application registration

    After execution, it closes the 1C: Enterprise 8 system.
    If parameter values ​​include spaces (for example, a path or file name), the values ​​must be enclosed in quotation marks.

    Examples

    How to run 1C:Enterprise 8 from the command line

    C:\Program Files\1cv8\bin\1cv8.exe" ENTERPRISE /F D:\Configurations\Typical\ControlTorg /N Username /P Password

    C:\Program Files\1cv8\bin\1cv8.exe" ENTERPRISE /S Server\Base /N Username /P Password

    C:\Program Files\1cv8\bin\1cv8.exe" CONFIG /F D:\Configurations\Typical\ControlTorg /N Username /P Password

    How to force 1C:Enterprise to unload the database from the command line

    C:\Program Files\1cv8\bin\1cv8.exe" CONFIG /F D:\Trading Admin /N Username /P Password /DumpIB c:\name.dt

    How to update the current configuration changes in the database configuration from the command line

    C:\Program Files\1cv8\bin\1cv8.exe" CONFIG /F D:\Trading Admin /N Username /P Password /UpdateDBCfg

    How to test and fix an infobase without checking referential integrity in automatic mode

    C:\Program Files\1cv8\bin\1cv8.exe" CONFIG /F"C:\DemoTrd2" /N"Fedorov (Administrator)" /P"" /IBcheckAndRepair -LogIntegrity

    How to perform a configuration check in automatic mode with the output of the check results to a file

    C:\Program Files\1cv8\bin\1cv8.exe" CONFIG /F"C:\DemoTrd2" /N"Fedorov (Administrator)" /P"" /OutD:\my\log.txt /CheckConfig -ClientServer -Client -ExternalConnectionServer -ExternalConnection -Server -DistributiveModules -IncorrectReferences -ConfigLogicalIntegrity -UnreferenceProcedures -HandlersExistence -EmptyHandlers

    How to shrink the log programmatically

    C:\Program Files\1cv8\bin\1cv8.exe" CONFIG /F"C:\DemoTrd2" /N"Fedorov (Administrator)" /P"" /OutD:\my\log.txt /ReduceEventLogSize 2004-12- 26 -saveAsC:\OldLog.elf

    How to unload application solution modules as text files from the command line

    C:\Program Files\1cv8\bin\1cv8.exe" CONFIG /F"C:\DemoTrd2" /N"Fedorov (Administrator)" /P"" /DumpConfigFiles "D:\1\11" -Module

    How to load help files saved in .htm format into the application solution

    C:\Program Files\1cv8\bin\1cv8.exe" CONFIG /F"C:\DemoTrd2" /N"Fedorov (Administrator)" /P"" /LoadConfigFiles "D:\1\11" -Help