NOTE: This page has been translated automatically from Russian to English. Original page.



Automatic restart 1c

Automatic restart 1c failures, outages, network losses and routine maintenance (means 1c)

Sometimes you need to 1c was constantly running on your computer, such as the organization of working time of employees, barcode reader, etc., and in case of possible failures, outages, network losses, routine work - program should restart automatically without user intervention.

 

To solve this problem, you can do the following:

 

Functionality: interactively starts processing that creates a task in the Windows task scheduler, the task starts at the specified 1c to schedule.

every 30 seconds transfer processing start time 1s to 5 minutes ahead if 1c hang - processing will no longer transfer time the task scheduler, and 1c will restart automatically after 5 minutes, then everything on a cycle.

 

Implementation.

1. At the start 1c starts processing (eg is it from PriNachaleRabotySistemy procedure)

2. The processing connect the standby processor

PodklyuchitObrabotchikOzhidaniya ( "PriOzhidanii", 30);

and create a procedure:

PriOzhidanii procedure () //! SM!

// - MMCH - create a file for the restart 1c SEE!
ABC = New TextDocument;

// BAT.DobavitStroku ( "pskill 1cv8"); // - MMCH - udalanie application on your computer, you must install pskill.exe SEE!

BAT.DobavitStroku ( "taskkill / IM 1cv8 * / f"); // - MMCH - udalanie applications, regular means of the application is closed


BAT.DobavitStroku ( "start / max C: \ Progra ~ 1 \ 1cv82 \ Common \ 1cestart.exe enterprise / AppAutoCheckMode / sserver1c \ 1c8Complex / N" "User" "/ pParol"); // - MMCH - run under a specific user 1c SEE!
BAT.Zapisat ( "c: \ client.bat", KodirovkaTeksta.ANSI);


// - MMCH - are created in the task scheduler task and translated HER TIME TO 5 MINUTES GO SEE!
// - MMCH - WHEN 1C hang after 5 minutes to restart PLANNER CM!
WshShell = New COMObekt ( "WScript.Shell");
/// We find the problem and remove - this is for XP, for more recent systems you can use the / F, then find and delete the task is not required
strokaKomandy = "schtasks / delete / TN" "1c RESTART" "/ F";
WshShell.Run (strokaKomandy, 0, True);
/// Create a task

// - MMCH - check to create a task, you can run the line is recommended in the Windows command line, see!
// - MMCH - to call for help on the parameters, type schtasks /? on the command line! SM!
strokaKomandy = "schtasks / create / sc minute / mo 10 / st" + Format (TekuschayaData () + 60 * 5 "DLF = T") + "/ tn" "1c RESTART" "/ tr c: \ client.bat / ru "" DOMEN \ UserWindows "" / RP "" ParolWindows "" ";
WshShell.Run (strokaKomandy, 0, True);
WshShell = Undefined;

KonetsProtsedury //


1C:Enterprise Developer's Community