Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rm
Message
From
02/09/2014 02:33:14
 
 
To
02/09/2014 02:31:53
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Rm
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01606885
Message ID:
01606892
Views:
69
You should encapsulate it in a TRY ... ENDTRY because if a file or sub-folder is in use you will also get the COM status error. So you can trap for the fault and take action.

>Sorry Jos - my bad. I was using a backslash after the folder name. works great thanks so much. nice job
>
>k
>
>>hmm, is it possible that some file or sub-folder is in use by another process?
>>
>>>it's all me. I created the folders on my computer.
>>>
>>>>When I get that sometimes on a server it is because of rights issues. Who created the folder and what user are you logged in as?
>>>>
>>>>
>>>>>thanks jos
>>>>>I tried it and got the following error 'unknown COM status code' on your third line (Delete....)
>>>>>
>>>>>k
>>>>>
>>>>>>>I am running into an issue in which I need to delete a directory that is not empty - it is filled with misc directories.
>>>>>>>example C:\dir1\dir2\dir3\dir4
>>>>>>>I want to shortcut the delete simply c:\dir1 *.* and in the process remove whatever other directories are tucked away in there .... - I am getting error message 'the directory is not empty'
>>>>>>>old solution is RM -f
>>>>>>>Is there a way to run the effect of the RM -F in VFP by using a short program.
>>>>>>>Or any other routes I might try?
>>>>>>>
>>>>>>>tnx
>>>>>>>k
>>>>>>
>>>>>>You can use Windows File System Object
>>>>>>
>>>>>>
>>>>>>oFSO = CREATEOBJECT("Scripting.FileSystemObject")
>>>>>>LCPATH = "C:\Your Folder Name"
>>>>>>oFSO.DeleteFolder( LCPATH  )
>>>>>>
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform