cancel
Showing results for 
Search instead for 
Did you mean: 

Start Process Action - PowerShell command

Neel1
MVP
hello, I am trying to run below stuff in start process but it is not executing.

data item d contain folder path to zip
data item c contain zip folder path

what I am missing here?  i want to run specifically using below action/VBO.

24212.png

------------------------------
Neeraj Kumar
Technical Architect
------------------------------
12 REPLIES 12

John__Carter
Staff
Staff
What's the error message? Probably you've already tried, but does the command work via the command line - is the syntax correct?

------------------------------
John Carter
Professional Services
Blue Prism
------------------------------

Hi Neeraj,

Probably the issues lies with file names having spaces. The first folder parameter does not seem to work if you have spaces in it. I would suggest once trying to remove the space from the name of the source folder which is [d] and then try to execute the command and see if it works. The destination zip file can have spaces which is [c] and it seems to work.

The only limitation I am seeing is if you have a nested directory with a lot of spaces in between then renaming all such folders can be a hassle. If possible I would suggest copy it to a root directory or some path without spaces and then rename the file in case it has spaces within it. Once you are able to remove all the spaces you can pass that file path into this command as a part of the data item [d]

24191.png
NOTE: Did multiple rounds of test around this and it seems even after using double quotes, single quotes and -f flag as well in this command, if the source file path has spaces around it then the command does not seem to work both manually and via automation as well.
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
Wonderbotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

Hello @John Carter - Yes i already tried. it is not working.  I am not getting error message .
although command is working fine manually .
i am doubting the syntax but at the same time i am not sure what to change in syntax.

this is what i am using
"Compress-Archive " &""""&[d]&""""&" "&""""&[c]&""""

------------------------------
Neeraj Kumar
Technical Architect
------------------------------

hello - Yes. It is  working if Source is not having space. it is working via different ways,

but not working if the folder to zip is having space.

Manually - it is working fine for both the cases for me.

------------------------------
Neeraj Kumar
Technical Architect
------------------------------

Hi,

Just a question... your files have special characters? (e.i: á, ï, ô, ç.....)?

I faced similar problems in the past when the names of the files or paths inside the folder have this kind of characters. (I solved it by using a different compression library, I don't know if you consider to use a little bit of code to fix this)



See you in the community! Bye 🙂

------------------------------
Pablo Sarabia
Solution Manager & Architect
Altamira Assets Management
Madrid
------------------------------

Hello @PabloSarabia - there is no special character in the folder path on which i am doing test..

failing for folder name having space .

what other library you have used.​

------------------------------
Neeraj Kumar
Technical Architect
------------------------------

Hi @Neeraj Kumar

We use "Ionic"​, but if you don't have special characters in the names I do not recommend you (is hard to use in my opinion 🙂 )

Better use the System.IO.Compression one. (also you need add this if you want to use by yourself System.IO.Compression.FileSystem.dll)

I attach you a VBO complete, try with this. (Only have one Action, Compress).

The code is simple:

ZipFile.CreateFromDirectory(Folder, zipFile);



Hope this helps you!

See you in the Community, bye 🙂




------------------------------
Pablo Sarabia
Solution Manager & Architect
Altamira Assets Management
Madrid
------------------------------

Hi Neeraj,

If going via System.IO.Compression.FileSystem.dll approach is applicable, you can download the Blue Prism asset from DX Exchange and use it as well since it has compress actions and other actions as well: Windows Compressed File

------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
Wonderbotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

Thanks @devneetmohanty07 @PabloSarabia for your valuable input.

The problem in using ​above VBO/method is that it is taking more then 1 minute to zip the folder (Folder is bit on heavier side).
Powershell command when tested manually is taking 10 seconds.

@EricWilson1 @shashank.kumar280  - Can you help here. ​​​

------------------------------
Neeraj Kumar
Technical Architect
------------------------------