Unattended Running Mode

Running E2S ››
Parent Previous Next


E2S can automatically run a list of processes using command line parameters if you have purchased an Unattended Mode licence. This enables, via a scheduling application such as Windows Task Scheduler, automatic uploads to Sage. Example batch and vbs files are included with the initial set-up of E2S for information purposes.


Please note that a new log file will be created for each unattended mode run.


There are 5 parameters which must be provided after the call to the E2S executable within double-quotes separated by spaces. The parameters are...


1. The full path to the Excel file or the database you wish to use. ("" = default Excel file specified in 'Excel File' field or your SQL Server set-up specified in SQL Configuration in Configuration)    

Note:. If you use a string ending in ".sql" (e.g., "E2SSQLDatabase2.sql") the database in the configuration will be changed to a database called "E2SSQLDatabase2" using the same server and user details. 


2. The options to run, in order (must match wording of tabs in the Excel file or table in SQL Server database, e.g., "Customers" or "ServiceInvoices"). 


3. Whether you want to delete the Excel file used for uploading when the automatic processing is complete. Options are...


4. Whether we want to send an email on completion. Options are... 


5. The Sage Company path you wish to connect to. ("" = default company specified in 'Sage Install Folder' in Configuration)


Please note that while all 5 parameters must be provided, all values except the 2nd (options to run) are optional. Those where you wish to use the system defaults (as in Configuration) should be provided as "". 



Here are some examples of how to use the parameters...


Run Suppliers option only but otherwise use all system default values...

C:\Excel2SageConnector\Connector\Excel2Sage50Connector.exe "" "Suppliers" "" "" ""


Here is an example that runs Customers and then deletes the file specified (after backing it up) and emails a specified address on completion… 

C:\Excel2SageConnector\Connector\Excel2Sage50Connector.exe "" "Customers" "Yes" "accounts@yourdomain.com" ""


To use a different Excel file running Customers, Suppliers and POs and leave the Excel file in place (regardless of the value of the 'Delete Excel File on Exit' field in Configuration you would run this…

C:\Excel2SageConnector\Connector\Excel2Sage50Connector.exe "C:\Temp\NewE2SImport.xlsx" "Customers,Suppliers,PurchaseOrders" "No" "" ""


Finally, an example of running Service Invoices from a non-standard xls, which we want to delete afterwards, sending an email on progress to the default address in Configuration and using a different Sage company to the one currently saved in Configuration...

C:\Excel2SageConnector\Excel2Sage50Connector.exe "C:\Temp\Excel2SageImportSIImport.xlsx" "ServiceInvoices" "Yes" "Yes" "C:\DOCUMENTS AND SETTINGS\ALL USERS\APPLICATION DATA\SAGE\ACCOUNTS\2022\COMPANY.003\ACCDATA\"


You can run in this mode in various ways such as typing out the command in a command prompt, or from the Windows Run box, by using a batch file or a Visual Basic Script (VBS) file. If you want to use Windows Task Scheduler you should note that many versions of Windows will not allow batch or script files with parameters to be used. We recommend you set up Windows Scheduler to run the E2S program with the parameters specified as follows...


(assuming a run of C:\Excel2SageConnector\Connector\Excel2Sage50Connector.exe  "" "Customers" "Yes" "accounts@yourdomain.co.uk" "")


Windows Task Scheduler..

The C:\Excel2SageConnector\Connector\Excel2Sage50Connector.exe is in the Run box and the  "" "Customers" "Yes" "accounts@yourdomain.co.uk" "" is in the arguments box.




Example of Unattended Running for multiple staff. 


If we were to imagine a scenario where a firm, had staff called John, Harry and Sue, each doing their own work that needed to be uploaded via E2S they could each have their own scheduled task set up on the machine where E2S is installed and set to run every hour. If they each have a task set up to run their own xls and delete it afterwards the process would only run when a file existed. They would simply have to save the xls to a shared location on that machine to cause the update to run automatically when its next scheduled time came.  


If John wanted to upload Purchase Orders, Harry Sales Orders and Sue Product Invoices their parameters would look like this...


John = "C:\E2SUploads\Excel2SageImportJohn.xlsx" "PurchaseOrders" "Yes" "john@yourdomain.com" ""

Harry = "C:\E2SUploads\Excel2SageImportHarry.xlsx" "SalesOrders" "Yes" "harry@yourdomain.com" ""

Sue = "C:\E2SUploads\Excel2SageImportSue.xlsx" "ProductInvoices" "Yes" "sue@yourdomain.com" ""


John's logfile/email would look something like this..

Automated processing - 5 command line parameters provided

Automated processing - Parameter 1 (xls to use) is C:\E2SUploads\Excel2SageImportJohn.xlsx

Excel file location changed to C:\E2SUploads\Excel2SageImportJohn.xlsx

Automated processing - Parameter 2 (options to run) = PurchaseOrders

Automated processing - Parameter 3 (delete xls on exit) = Yes

Automated processing - Parameter 4 (send email) = Yes

Automated processing - Parameter 5 (company path) is blank, system default used

Total logins to date = 113, total records uploaded to date= 19974

Connected to Red IT Solutions Limited L50

------------------

Option found... PurchaseOrders

Starting Upload Purchase Orders To Sage

UploadPurchaseOrdersToSage - Post purchase order transaction

Purchase Order 2001 posted successfully as order number 13

UploadPurchaseOrdersToSage - Post purchase order transaction

Purchase Order 2002 posted successfully as order number 14

Finished loading Purchase Orders To Sage

------------------

Excel file location changed to C:\Excel2SageConnector\Excel2SageImport.xlsx

Disconnected from Sage

Excel File C:\E2SUploads\Excel2SageImportJohn.xls deleted

Excel File Backed up to safe copies

Total logins this session = 1, total records uploaded this session = 2

Total logins = 114, total records uploaded = 19976

--------------------Exit------------------------



Assuming Harry had not created a xls file this hour because there were no invoices to load - his logfile/email would look like this...

Automated processing - 5 command line parameters provided

Automated processing - Parameter 1 (xls to use) is C:\E2SUploads\Excel2SageImportHarry.xlsx

Error in command line parameter 1. C:\E2SUploads\Excel2SageImportHarry.xls is not a valid *.xlsx file

Automated processing - Parameter 2 (options to run) = SalesOrders

Automated processing - Parameter 3 (delete xls on exit) = Yes

Automated processing - Parameter 4 (send email) = Yes

Automated processing - Parameter 5 (company path) is blank, system default used

--------------------Exit------------------------



Sue's logfile/email would look something like this..

Automated processing - 5 command line parameters provided

Automated processing - Parameter 1 (xls to use) is C:\E2SUploads\Excel2SageImportSue.xlsx

Excel file location changed to C:\E2SUploads\Excel2SageImportSue.xlsx

Automated processing - Parameter 2 (options to run) is ProductInvoices

Automated processing - Parameter 3 (delete xls on exit) = Yes

Automated processing - Parameter 4 (send email) = Yes

Automated processing - Parameter 5 (company path) = blank, system default used

Total logins to date = 114, total records uploaded to date= 19976

Connected to Red IT Solutions Limited L50

------------------

Option found... ProductInvoices

Starting Upload Sales Product Invoices To Sage

UploadInvoiceToSage - Post sales product invoice transaction

Sales Product Invoice 0001 posted successfully as invoice number 62

UploadInvoiceToSage - Post sales product invoice transaction

Sales Product Invoice 0002 posted successfully as invoice number 63

Finished loading Sales Product Invoices To Sage

------------------

Excel file location changed to C:\Excel2SageConnector\Excel2SageImport.xlsx

Disconnected from Sage

Excel File C:\E2SUploads\Excel2SageImportSue.xlsx deleted

Excel File Backed up to safe copies

Total logins this session = 1, total records uploaded this session = 2

Total logins = 115, total records uploaded = 19978

--------------------Exit------------------------