Login | |
|
 |
RE: First time scripting - 7/26/2006 2:18:30 AM
|
|
 |
|
| |
Country73
Posts: 735
Score: 10
Status: offline
|
Welcome to the forum and the world of VBScript! For starters, I would recommend looking at the post "Read Me First" in the "WSH & Client Side VBScript". You will find a lot of links to the documentation to assist in writing this script. You should also try a search on our forum for locating a file, running against a list and deleting a file. You may just find that someone has already written a script that you are wanting to create, or a script that just needs a little modification to do what your want. Once you have a script put together then feel free to post what you have and any questions, or obstacles, you come across. Good Luck!
|
|
| |
|
|
|
 |
RE: First time scripting - 7/26/2006 2:19:15 AM
|
|
 |
|
| |
ebgreen
Posts: 5246
Score: 31
Joined: 7/12/2005
Status: online
|
I would start by reading the "Read me first" post that is pinned at the top of this forum. Then I would search these fora for keywords like "read text file", "FileSystemObject", "Delete file".
_____________________________
"... 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: First time scripting - 7/27/2006 5:38:45 AM
|
|
 |
|
| |
ebgreen
Posts: 5246
Score: 31
Joined: 7/12/2005
Status: online
|
First, the script as it is written will only delete the file from your computer. Not from the computer that is passed into the script. Second, is the file that you are trying to delete in use?
_____________________________
"... 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: First time scripting - 7/27/2006 6:39:22 AM
|
|
 |
|
| |
ebgreen
Posts: 5246
Score: 31
Joined: 7/12/2005
Status: online
|
Well, it works perfectly for me so I think you might not have the permissions that you think you have. Try running just this and nothing else: '=================== 'delete c:\windows\cmdow.exe '=================== Dim oFSO Set oFSO = CreateObject("Scripting.FileSystemObject") If (oFSO.FileExists("C:\windows\cmdow.exe")) Then oFSO.DeleteFile("C:\windows\cmdow.exe") Else WScript.Echo "Unable to locate file" End if Set oFSO = Nothing Wscript.Quit
_____________________________
"... 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
|
|
| |
|
|
|
|
|