Sign in to follow this  
Followers 0
RBrown1375

Removing Files and Folders

2 posts in this topic

I have gone through the help file and tried everything it shows samples on for my script except I can't get it to del a folder and its contents. I've tried DirRemove and FileDelete and nothing. Here is my code and I was wondering if I could get another eye on this. The goal of this script is to uninstall CCMSetup from Servers (Win 2003 and 2008r2) then I want to remove the CCMSetup folder and its files and this is where is fails. I've been concentrating on Win2k3 first then I'll move over to Win2k8r2.

Thanks

#RequireAdmin
; Get the OS version number without an API call.
Local $sFldr1 = "C:\Windows\System32\ccmsetup\"
;Local $sFldr2 = ""

Func _OSVersion()
    Return RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\", "CurrentVersion")
EndFunc   ;==>_OSVersion
If @OSVersion = "WIN_2003" Then
  RunWait(@WindowsDir & "\System32\CCMSetup\CCMSetup.exe /uninstall")
  Sleep(3000)
  DirRemove($sFldr1, 1)
   
EndIf
If @OSVersion = "WIN_2008R2" Then
  MsgBox(0, "@OSVersion()", "BatMan")
EndIf ;==> End If

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0