Delete file on connected phone

Hi, I’m trying to delete the file on connected phone but failed on the absolute path. Would anyone help?

value of the activitiy delete is :“本機\HUAWEI P20 Pro\內部儲存裝置\DCIM\Camera”+path.GetFileName(item)

image

@healsko_ho

Hi i would suggest that your print your path using write line, to check if it’s correct… than try the delete activity…

@mz3bel
The write line result is fine but the path in delete activity has additonal one.

@healsko_ho

Well this is a start… show me the code on your delete activity

@mz3bel

ForEach item in Directory.GetFiles(“E:\Photo\2019-02-17 xxx”)

Write Line: “本機\HUAWEI P20 Pro\內部儲存裝置\DCIM\Camera”+path.GetFileName(item)

Delete: “本機\HUAWEI P20 Pro\內部儲存裝置\DCIM\Camera”+path.GetFileName(item)

@healsko_ho

I can’t tell what’s went wrong here, but i noticed something, you need the full path to delete your file…

The “Delete…” is it a variable or argument, use a write line, check it content, if it’s not has a static content…

Let me know how it goes for you… Mostly the path changes during the execution of your project…

@mz3bel
It should be MTP issue but thanks anyway.

In case anyone else face the same issue, please refer to below link to deep further.

1 Like