function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
The_A-RodThe_A-Rod 

Write batch file to run data loader upsert

I'm trying to use the Windows task scheduler to launch an upsert process and therefore need to create a .bat file to run that process.

My process.bat file is in the following folder:
C:\Program Files (x86)\salesforce.com\data loader\bin\

My process-conf.xml file along with all other data is the the following folder:
\\fsdata01\Department\eCommerce\BIU\Salesforce\Dataloader\Dev\2nd test with GCD mappings

the name of my process is "secondtestmapping"

the process works fine when I run it manually from the cmd, but I can't figure out how to translate that to a batch file.

Can anyone help?!


FYI, the command I use in the cmd to manually run the process is:
process.bat "\\fsdata01\Department\eCommerce\BIU\Salesforce\Dataloader\Dev\2nd test with GCD mappings" secondtestmapping
Amit Chaudhary 8Amit Chaudhary 8
Please Copy below code and save as "Account.bat"
@ECHO OFF
SETLOCAL
REM # History:
REM # ~~~~~~~~
REM ####################################################################

REM ### Configurable variables
SET DATALOADER_HOME=C:\Program Files (x86)\salesforce.com\Data Loader\
SET PROJECT_HOME=C:\CLI


cd /d "%DATALOADER_HOME%\bin"
echo ==================== START:%DATE% - %TIME% ==========================
echo %DATALOADER_HOME%\bin\process.bat %PROJECT_HOME%\conf UpsertAccount
call "%DATALOADER_HOME%\bin\process.bat" "%PROJECT_HOME%\conf" UpsertAccount >> C:\CLI\log\Account.txt
SET ERRORCD=%ERRORLEVEL%
echo ERRORLEVEL=%ERRORCD%
echo ====================  END :%DATE% - %TIME% ==========================


cd /d "%CURDIR%"
@ECHO ON
exit /B %ERRORCD%

Please update DATALOADER_HOME and PROJECT_HOME path base on your system. And update your process name like "UpsertAccount".

Please mark this as solution by selecting it as best answer if this solves your problem, So that if anyone has this issue this post can help




 
Mayur Bari 7Mayur Bari 7
Hello Amit, I have upgraded the version due to TLS1.0 issue with old data loader and now I am facing the issue when using the data loader version 40. Could you please help me to create a .bat file? My existing code is as below

@echo on
"C:\Program Files (x86)\salesforce.com\Data Loader\Java\bin\java.exe" -cp "C:\Program Files (x86)\salesforce.com\Data Loader\dataloader-24.0.0-jar-with-dependencies.jar" -Dsalesforce.config.dir="D:\Backup\conf" com.salesforce.dataloader.process.ProcessRunner process.name=MDMEXtract
@Pause
:end

@Amit.
Thank you!!!