Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.scripting.vbscript > #11300
| From | "Auric__" <not.my.real@email.address> |
|---|---|
| Newsgroups | microsoft.public.scripting.vbscript |
| Subject | Re: Delete folder with spaces in path |
| Date | 2016-05-05 07:37 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <XnsA5FF70631C61auricauricauricauric@213.239.209.88> (permalink) |
| References | <8cc78a54-85aa-46e7-b701-092b99b4c53f@googlegroups.com> |
peter.vandewalle wrote:
> I'm trying to delete a folder in the 'Program Files'. But I don't see why
> this wont work...
> Here's the code I'm trying:
>
> Sub DeleteAFolder(filespec)
> Dim fso
> Set fso = CreateObject("Scripting.FileSystemObject")
> fso.DeleteFolder(filespec)
> End Sub
>
> DeleteAFolder("C:\Program Files\TestFolder")
>
>
> Result: "Permission denied"
Your script requires admin privileges.
> I also tried:
>
> Sub DeleteAFolder(filespec)
> Dim fso
> Set fso = CreateObject("Scripting.FileSystemObject")
> fso.DeleteFolder(filespec)
> End Sub
>
> DeleteAFolder("""C:\Program Files\TestFolder""")
>
>
> Result: "Path not found"
This version is looking for a folder named "C:\Program Files\TestFolder",
*including the quotation marks*. The first version is correct.
> Any ideas?
*Why* are you deleting something in Program Files?
--
- Are you questioning my judgment?
- Is your judgment so perfect that it may never be questioned?
Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Next in thread | Find similar
Delete folder with spaces in path peter.vandewalle@designexpress.eu - 2016-05-05 00:01 -0700
Re: Delete folder with spaces in path "Auric__" <not.my.real@email.address> - 2016-05-05 07:37 +0000
Re: Delete folder with spaces in path peter.vandewalle@designexpress.eu - 2016-05-05 05:41 -0700
Re: Delete folder with spaces in path "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-05-05 14:52 +0200
Re: Delete folder with spaces in path JJ <jj4public@vfemail.net> - 2016-05-06 06:09 +0700
csiph-web