Able to start process with nupkg bat file but folder is different

Hello,

my requirement is to start UiPath script using batch file which i am starting using UiPath workflow only.
initially i we use ti start with below batch file .
“C:\Program Files\UiPath\Studio\UiRobot.exe” -file “E:\apps2_s2_rpa\FactoryINDUSAPPS2\iPLAN\User Addition-License Activation\Main.xaml”

but due to new Windows or cross-platform projects it is not supported.
so solution is we need to publish project in one folder and then we need to give path of .nupkg filelike below.
“C:\Program Files\UiPath\Studio\UiRobot.exe” -file “E:\apps2_s2_rpa\FactoryINDUSAPPS2\iPLAN\User Addition-License Activation\User.Addition-License.Activation.1.0.1.nupkg”

it able to start file if i pass batch file path in start process activity but issue is when i developed project i have stored in e drive like blwo folder -
E:\apps2_s2_rpa\FactoryINDUSAPPS2\iPLAN\User Addition-License Activation

but now when i am starting same project using batch file .nupkg file has created folder in below path -
C:\Users\ADM-FR-HAELKHIA.nuget\packages\jira_workorders\1.0.1\content

so taking all excel file paths from that c drive folder.

so how can i solve this?
if i need to modify something then everytime i need to publish?is it create new folder again?
or should i directly open UiPaths script from above c drive location and update my script and save?and use that path only instead e drive?

please suggest me

@ashokkarale @Anil_G

@Mathkar_kunal

ideally while making the package include the files you need as well in the same project and publish it..so that when it runs it would download the files you published as well..and yes you need to update package whenever you have new files or edits

editing or placing files directly in folder is not advised

cheers

ok but what about excel paths?
it is initially taking from e drive and now after publishing to .nupkg it has moved to c drived

@Mathkar_kunal

ideally you should use relativepath for any file inside your projetc instead of hardcoded paths..project folder would be appended automatically during runtime

cheers

ok

but suppose i have script A and B
i need to open file created by script A and stored in A’s script folder in script B

in that case what should i do

@Mathkar_kunal

copy file also supports relative

also Environment.CurrentDirectory will give you the project directory as well if you want to use while saving

cheers

ok i am trying doing that.

Yes, reltve path works fine if the file is part of the same project package.

But in your case Script A and Script B are separate scripts. After publishing, each script runs from its own folder under ‘.nuget\packages’, so relying on the project folder may not work consistently.

A better approach is to store the generated file in a common shared location (for example 'D:\RPA\Output' or another fixed folder). Script A can save the file there, and Script B can read it from the same location.

Relative paths are useful for files that are packaged with the project itself, but for files created during runtime or shared between different automations, a fixed external folder is usually safer.

Also, it’s not recommended to edit anything directly inside the ‘.nuget\packages’ folder. Any changes should be done in your project and then published again.

Happy automating!

Regards
Dhruba

ok for same project fiels i have used relative path as suggested and if script B need to use file from script A the in that case i have used absolute path with variables and those variables like file name,folder name saved in config file.

after publishing packge as .nupkg file i observed that one folder is not showing in c drive where it is publishing which is present i script b.

anything we need to check /click while doing publish so everything ,wach folder file will go there

for Script B using files from Script A, better not depend on absolute path or another package folder. Keep those shared files in a common location nstead of hardcoded path and read that path from config.

Regards,
Dhruba

@Mathkar_kunal

empty folder would not be published. Place a dummy file in it so that the folder is also published

cheers