/bundles/itninjaweb/img/Breadcrumb_cap_w.png
Hi,

I have a file I need to delete in "C:\prgram files\Microsoft Office\Office11\Start Up\pwd.dot". Does anyone have a script that would do this? I have tried modifying the scripts I have had posted here before, but have been unsuccsessfull. Plus I have a time limit!

Thanks,

Mike.
0 Comments   [ - ] Hide Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity

Answers

0
Is there a specific language you must use? Which language are you using?
Answered 12/04/2006 by: Secondlaw
Third Degree Blue Belt

Please log in to comment
0
Try this :

Const FolderName = "Microsoft Office\Office11\StartUp"

Const DeleteEvenIfReadOnly = TRUE
Const FileToDelete = "pwd.dot"

Dim oFSO, oWSH
Dim sProgramFilesFolder

' Instantiate the various objects needed by this script
'
set oFSO = CreateObject("Scripting.FileSystemObject")
set oWSH = CreateObject("Wscript.Shell")

' Find the current Program Files folder - could be on C: or D: drive for example
sProgramFilesFolder = oWSH.ExpandEnvironmentStrings("%ProgramFiles%")
sProgramFilesFolder = sProgramFilesFolder & "\"

On Error Resume Next
If oFSO.FileExists(sProgramFilesFolder & FolderName & "\" & FileToDelete) then
oFSO.DeleteFile(sProgramFilesFolder & FolderName & "\" & FileToDelete), DeleteEvenIfReadOnly
end if

set oFSO = Nothing
set oWSH = Nothing



Regards,

Spartacus
Answered 12/04/2006 by: spartacus
Black Belt

Please log in to comment