Your Products have been synced, click here to refresh
DO/ V1=FILE/DIALOG,Choose a file to delete. V2=FILE/EXISTS,V1 IF/V2<>0 COMMENT/OPER,File exists. Ready to delete. FILE/DELETE,V1 END_IF/ C1 = COMMENT/YESNO,NO,Full Screen=NO, Do you want to delete another file ? UNTIL/C1.INPUT=="NO"
Something like this ?
DO/ V1=FILE/DIALOG,Choose a file to delete. V2=FILE/EXISTS,V1 IF/V2<>0 COMMENT/OPER,File exists. Ready to delete. FILE/DELETE,V1 END_IF/ C1 = COMMENT/YESNO,NO,Full Screen=NO, Do you want to delete another file ? UNTIL/C1.INPUT=="NO"
https://docs.hexagonmi.com/pcdmis/2023.1/en/helpcenter/mergedProjects/core/25_inputoutput_topics/Deleting_a_File.htm?rhhlterm=file%20commands&rhsyn s=%20
Maybe:
ASSIGN/MYVAR="*.TXT"
FILE/DELETE, MYVAR
...but you would need to specify the entire path.
Sub AfficherInfoDossier() specdossier = "C:\temp" Dim fs, f, s Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFolder(specdossier) Set fc = f.Files For Each f1 In fc s = f1.Name If Right(s, 4) = ".txt" Then MsgBox (s) End If Next End Sub
Why don't you set something up in Windows Scheduler and run a task, piggybacked off a powershell to delete files with specific file extensions? Then set it up on a schedule.
ASSIGN/FIL_PATH="C:\\TEST\\" FPTR =FILE/OPEN,C:\Users\Public\Documents\Hexagon\PC-DMIS\Del_Txt.bat,WRITE FILE/WRITELINE,FPTR,"del "+FIL_PATH+"*.txt" FILE/CLOSE,FPTR,KEEP COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=YES,TIME DELAY=1,OVC=NO, Creating batch file EXTERNALCOMMAND/NO_DISPLAY, WAIT ; C:\USERS\PUBLIC\DOCUMENTS\HEXAGON\PC-DMIS\DEL_TXT.BAT COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=YES,TIME DELAY=1,OVC=NO, Deleting text files FILE/DELETE,C:\USERS\PUBLIC\DOCUMENTS\HEXAGON\PC-DMIS\DEL_TXT.BAT
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |