Could Not find part of a Path

Utilizing Unzip activity and I am receiving the error: Could not find a part of the path 'C:\Users\acolo\Documents\UiPath\Download_Comp Reports_Varicent_ThisPC\Desktop\Sales Compensation This location does not exist. The file location that I have spelled out in hte variable is: This PC\Desktop\Sales Compensation

Please update your variable to the fully qualified path as follows.
This PC is not a path.

Updated Variable Value: C:\Users\acolo\Desktop\Sales Compensation

Karthik Byggari

1 Like

Thank you, I made the change and now receiving the following error: Could not find file ‘C:\Users\acolo\Desktop\Sales Compensation Statement’

Hi @annemcolo,

  • Use Path.Combine when “adding” path parts.
  • If dealing with special folders (Desktop, MyDocuments, …) use Environment.ExpandEnvironmentVariables
  • You might need to surround your path with ‘"’ as it contains spaces

for example (I don’t have my Studio so I didn’t error checked)

filename = "Sales Compensation Statement"
desktop = Environment.ExpandEnvironmentVariables("%USERPROFILE\Desktop")
destination = Path.Combine(desktop, filename)
destination = """" & destination & """"

in_Config("destination") = "%USERPROFILE\Desktop\Sales Compensation Statement"
destination = in_Config("destination").ToString
destination = Environment.ExpandEnvironmentVariables(destination)

1 Like