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)



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

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


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


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)


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…

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