![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | "DeleteFolder" not works properly Hello, I'm using the VBscript to delete a folder which contains Read-only files. here's the code, FileName: del.vbs Code: Dim FSO Set FSO = CreateObject("Scripting.FileSystemObject") If ( FSO.FolderExists("C:\GPS8.0") ) Then FSO.DeleteFolder "C:\GPS8.0",True MsgBox "FSO.DeleteFolder C:\GPS8.0\ -OK " ***************** when I manually execute this file, del.vbs,i.e. by double-clicking the del.vbs, it is deleting the folder(with read-only files). But when I trigger this .vbs file from inside a C++ application,say,using run-time library function, system("del.vbs");, it is not. It is emptying the folder but cannot delete the folder. After emptying the folder, I'm getting the Error # 70, Error Description:Permission Denied I'm the logged on user in the PC at this point of time and I 'm part of Adminisrtator's group. Help please. I heard that something like admin rights or privileges needs to be sent to the filesystem object when triggered from C++ application. Thanks, Sudhakar |
My System Specs![]() |
| | #2 (permalink) |
| | Re: "DeleteFolder" not works properly "Sudhakar" <Sudhakar@xxxxxx> wrote in message news:B1432178-07E3-4F92-8F31-5E6BC0A43C5A@xxxxxx Quote: > Hello, > > I'm using the VBscript to delete a folder which contains > Read-only files. > > here's the code, > FileName: del.vbs > Code: > Dim FSO > Set FSO = CreateObject("Scripting.FileSystemObject") > If ( FSO.FolderExists("C:\GPS8.0") ) Then > FSO.DeleteFolder "C:\GPS8.0",True > MsgBox "FSO.DeleteFolder C:\GPS8.0\ -OK " > ***************** > when I manually execute this file, del.vbs,i.e. by double-clicking the > del.vbs, it is deleting the folder(with read-only files). > But when I trigger this .vbs file from inside a C++ application,say,using > run-time library function, system("del.vbs");, it is not. > It is emptying the folder but cannot delete the folder. After emptying the > folder, I'm getting the Error # 70, Error Description:Permission Denied > > I'm the logged on user in the PC at this point of time and I 'm part of > Adminisrtator's group. > Help please. > I heard that something like admin rights or privileges needs to be sent to > the filesystem object when triggered from C++ application. > > Thanks, > Sudhakar can do it directly from C++? Having a homogenous C++ would be much cleaner and you would not incur the overhead of invoking the VB Script interpreter. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: "DeleteFolder" not works properly "Pegasus [MVP]" wrote: Quote: > > "Sudhakar" <Sudhakar@xxxxxx> wrote in message > news:B1432178-07E3-4F92-8F31-5E6BC0A43C5A@xxxxxx Quote: > > Hello, > > > > I'm using the VBscript to delete a folder which contains > > Read-only files. > > > > here's the code, > > FileName: del.vbs > > Code: > > Dim FSO > > Set FSO = CreateObject("Scripting.FileSystemObject") > > If ( FSO.FolderExists("C:\GPS8.0") ) Then > > FSO.DeleteFolder "C:\GPS8.0",True > > MsgBox "FSO.DeleteFolder C:\GPS8.0\ -OK " > > ***************** > > when I manually execute this file, del.vbs,i.e. by double-clicking the > > del.vbs, it is deleting the folder(with read-only files). > > But when I trigger this .vbs file from inside a C++ application,say,using > > run-time library function, system("del.vbs");, it is not. > > It is emptying the folder but cannot delete the folder. After emptying the > > folder, I'm getting the Error # 70, Error Description:Permission Denied > > > > I'm the logged on user in the PC at this point of time and I 'm part of > > Adminisrtator's group. > > Help please. > > I heard that something like admin rights or privileges needs to be sent to > > the filesystem object when triggered from C++ application. > > > > Thanks, > > Sudhakar > Why would you want to invoke a VB Script file to delete a folder when you > can do it directly from C++? Having a homogenous C++ would be much cleaner > and you would not incur the overhead of invoking the VB Script interpreter. > > Hi , this purpose. PLease help using VBScript Quote: > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: "DeleteFolder" not works properly "Sudhakar" <Sudhakar@xxxxxx> wrote in message news:7E51A768-F219-4343-BA65-6E1DBE7BB2A0@xxxxxx Quote: > > > "Pegasus [MVP]" wrote: > Quote: >> >> "Sudhakar" <Sudhakar@xxxxxx> wrote in message >> news:B1432178-07E3-4F92-8F31-5E6BC0A43C5A@xxxxxx Quote: >> > Hello, >> > >> > I'm using the VBscript to delete a folder which contains >> > Read-only files. >> > >> > here's the code, >> > FileName: del.vbs >> > Code: >> > Dim FSO >> > Set FSO = CreateObject("Scripting.FileSystemObject") >> > If ( FSO.FolderExists("C:\GPS8.0") ) Then >> > FSO.DeleteFolder "C:\GPS8.0",True >> > MsgBox "FSO.DeleteFolder C:\GPS8.0\ -OK " >> > ***************** >> > when I manually execute this file, del.vbs,i.e. by double-clicking the >> > del.vbs, it is deleting the folder(with read-only files). >> > But when I trigger this .vbs file from inside a C++ >> > application,say,using >> > run-time library function, system("del.vbs");, it is not. >> > It is emptying the folder but cannot delete the folder. After emptying >> > the >> > folder, I'm getting the Error # 70, Error Description:Permission Denied >> > >> > I'm the logged on user in the PC at this point of time and I 'm part of >> > Adminisrtator's group. >> > Help please. >> > I heard that something like admin rights or privileges needs to be sent >> > to >> > the filesystem object when triggered from C++ application. >> > >> > Thanks, >> > Sudhakar >> Why would you want to invoke a VB Script file to delete a folder when you >> can do it directly from C++? Having a homogenous C++ would be much >> cleaner >> and you would not incur the overhead of invoking the VB Script >> interpreter. >> >> Hi , > for > this purpose. PLease help using VBScript > Script file!) from your C++ application: @echo off echo %date% %time% %UserName% >> c:\test.txt rd /s /q "c:\My Folder\SomeFolder" 1>>c:\test.txt 2>>&1 The log file c:\test.txt will probably tell you what's wrong. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| MIcrophone's wont work. "Audio not working properly"? | Sound & Audio | |||
| "Provider cannot be found. It may not be properly installed Error --2146824582" | Network & Sharing | |||
| "Could not perform this operation because the default mail client is not properly installed" | Vista General | |||
| Search - Detail View - "Folder" is backwards - can't sort properly | Vista file management | |||
| Works 8.5 in Vista: "Microsoft Works has stopped working" | Vista General | |||