cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Unable to Delete folder created by script in Repository

SwapnilP
11-Garnet

Unable to Delete folder created by script in Repository

SwapnilP_0-1593000533550.png

I have used ExportSourceControlledEntitiesToZipFile method to Export Project Data to Zip file in Folder. 

 

I am getting below error if I try to open that folder also.

SwapnilP_1-1593000755398.png

1 ACCEPTED SOLUTION

Accepted Solutions
PaiChung
22-Sapphire I
(To:SwapnilP)

Most likely the @ is the issue.

I'd recommend rewriting your script to create folders without special characters.

Go onto the server directly to remove this folder.

 

If you don't have direct server access, you can do some research into escape characters and try to delete it with an escape character at least for the @ symbol

What I'm not sure is if you need to do a URL escape %40 or force it into the jscript as a string. You may have to do it through a service though not the direct execute of the filerepository service

View solution in original post

5 REPLIES 5
PaiChung
22-Sapphire I
(To:SwapnilP)

Most likely the @ is the issue.

I'd recommend rewriting your script to create folders without special characters.

Go onto the server directly to remove this folder.

 

If you don't have direct server access, you can do some research into escape characters and try to delete it with an escape character at least for the @ symbol

What I'm not sure is if you need to do a URL escape %40 or force it into the jscript as a string. You may have to do it through a service though not the direct execute of the filerepository service

Yes Removing @ from Foldername works.

 

Is there any way to rename zip file generated by ExportSourceControlledEntitiesToZipFile method ?

Currently its taking Projectname by Default and Overwrites if exported on same location. I don't want it to overwrite but create new zip if export service is run again.

 

Manual Export Allows scope to name the zip so there should be way.

SwapnilP_0-1593004921822.png

 

PaiChung
22-Sapphire I
(To:SwapnilP)

Don't think there are options in the unzip command, so I would recommend to anticipate the overwrite and place them in differently named folders from the start.

Hi @PaiChung 

 

I found way to rename file. Its working If I execute rename service from SystemRepository thing but if same method is in Script then it doesn't rename. I am using Below code.

 

Things["SystemRepository"].RenameFile({
path: "/" + destinationpath + "OEE.zip" /* STRING */,
name: zipfilename /* STRING */,
overwrite: True /* BOOLEAN */
});

 

I have tested all variables are correct. 

PaiChung
22-Sapphire I
(To:SwapnilP)

Not exactly sure what might be the issue sorry, either not treating it as a string, or maybe filtering out characters that aren't permitted.

Top Tags