Login | |
|
 |
RE: Delete folders on a different Server - 7/19/2006 5:02:39 AM
|
|
 |
|
| |
Snipah
Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
|
Hiya Frank, welcome... I don't see why it wouldn't be possible...IF the folder actually exists ofcourse.. You could better place an FolderExists before running the FolderDelete process.. What have you tried for it to work on a different server? Snipah
_____________________________
For more information, please see the "Read me First" topic. http://www.visualbasicscript.com
|
|
| |
|
|
|
 |
RE: Delete folders on a different Server - 7/19/2006 7:51:35 AM
|
|
 |
|
| |
Country73
Posts: 732
Score: 10
Joined: 8/25/2004
From: USA
Status: offline
|
Do you have a typo on the line that you tried for your server? Shouldn't it be something like: Set objFolder = objFSO.GetFolder("\\svrapps1\C$\Documents and Settings\All Users\Application Data\FormScapeSoftware\data\Logs" )
|
|
| |
|
|
|
 |
RE: Delete folders on a different Server - 7/19/2006 11:43:05 PM
|
|
 |
|
| |
Country73
Posts: 732
Score: 10
Joined: 8/25/2004
From: USA
Status: offline
|
Did you try what Snipah suggested? Const DeleteReadOnly = True Set objFSO = CreateObject("Scripting.FileSystemObject") IF objFSO.FolderExists("\\svrapps1\C$\Documents and Settings\All Users\Application Data\FormScapeSoftware\data\Logs" ) Set objFolder = objFSO.GetFolder("\\svrapps1\C$\Documents and Settings\All Users\Application Data\FormScapeSoftware\data\Logs" ) Set colSubfolders = objFolder.Subfolders For Each objSubfolder in colSubfolders If DateAdd("d",-30, Now()) > objSubfolder.DateCreated then objFSO.deletefolder objSubfolder, DeleteReadOnly End If Next Set objFSO = Nothing Set objFolder = Nothing Set objSubFolder = Nothing Set colSubfolders = Nothing END IF Wscript.Quit
|
|
| |
|
|
|
 |
RE: Delete folders on a different Server - 7/20/2006 4:29:00 AM
|
|
 |
|
| |
ebgreen
Posts: 4969
Score: 31
Joined: 7/12/2005
Status: online
|
There is a perfectly good example in the WSH documentation which can be obtained by reading the "Read Me First" post that is pinned at the top of this forum.
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: Delete folders on a different Server - 7/20/2006 6:20:05 AM
|
|
 |
|
| |
ebgreen
Posts: 4969
Score: 31
Joined: 7/12/2005
Status: online
|
In the WSH documentation, click on the Index tab. Then type 'map' into the find box. the item that should be highlighted is the MapNetworkDrive Method that topic will explain how to map a network drive giving user name and password.
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
|
|