Getting Access Denied Error while running Batch File from BP
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-04-21 10:47 AM
I am using below batch script to divide my large text file into multiple files based on the no of lines -
@Echo Off
Setlocal EnableExtensions DisableDelayedExpansion
Set "inFile=%1%"
Set "nLines=50000"
If Not Exist "%inFile%" GoTo :EOF
For %%A In ("%inFile%") Do Set "fName=%%~nA"&Set "fExt=%%~xA"
Set "count=0"
For /F %%A In ('Find /C /V ""^<"%inFile%"') Do Set "fLines=%%A"
(For /L %%A In (1 1 %fLines%) Do (Set/P "data="
Set/A "file=(count/%nLines%)+1", "count+=1"
SetLocal EnableDelayedExpansion
(Echo=!data!)>>"%fName%_!file!%fExt%"
EndLocal))<"%inFile%"
EndLocal
GoTo :EOF
while running this batch file from cmd i am not getting any error and getting the desired output. But when i run the same from BP start Process action it gives me "access is denied" error. please help me to find the issue. I have attached error image for the reference.

------------------------------
Rajkumari choudhary
------------------------------
@Echo Off
Setlocal EnableExtensions DisableDelayedExpansion
Set "inFile=%1%"
Set "nLines=50000"
If Not Exist "%inFile%" GoTo :EOF
For %%A In ("%inFile%") Do Set "fName=%%~nA"&Set "fExt=%%~xA"
Set "count=0"
For /F %%A In ('Find /C /V ""^<"%inFile%"') Do Set "fLines=%%A"
(For /L %%A In (1 1 %fLines%) Do (Set/P "data="
Set/A "file=(count/%nLines%)+1", "count+=1"
SetLocal EnableDelayedExpansion
(Echo=!data!)>>"%fName%_!file!%fExt%"
EndLocal))<"%inFile%"
EndLocal
GoTo :EOF
while running this batch file from cmd i am not getting any error and getting the desired output. But when i run the same from BP start Process action it gives me "access is denied" error. please help me to find the issue. I have attached error image for the reference.
------------------------------
Rajkumari choudhary
------------------------------
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-04-21 02:17 PM
Hi Rajkumari,
I think it is trying to create files in Blue Prism directory. Try changing the directory to file path where you want to save the file in batch file or for file path of batch file use cd %~dp0
Hopefully, this will resolve the issue.
------------------------------
Gopal Bhaire
Analyst
Accenture
------------------------------
