/build/static/layout/Breadcrumb_cap_w.png

VB Script to Change the permissions of a folder, copy contents of a folder and rename the folder

Guys,

I know you guys are too good at scripting. But for the newbies that are trying to learn something. Just in case, if they need something like this. This might be of little help.

VB Script to Change the permissions of a folder, copy contents of a folder and rename the folder

Dim objFSO

Dim objShell

Dim strSysDir

Dim Calcds

Dim FoldPerm

 

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objShell = CreateObject("WScript.Shell")

 

 

strSysDir = objFSO.GetSpecialFolder(1).Path

If Right(strSysDir,1) <> "\" Then strSysDir = strSysDir & "\"

Calcds = sSysDir & "cacls.exe"

 

FoldPerm = """" & Calcds &"""" & """c:\Program Files\Java\jre7""" & "  /t /e /c /p " & """Users""" & ":F"

objShell.Run FoldPerm, 1, True

 

 

If objFSO.FolderExists("C:\windows\sun\java\deployment\Lib\Trusted") Then

 

objFSO.CopyFolder "C:\windows\sun\java\deployment\Lib\Trusted", "C:\Program Files\Java\jre7\Lib\Ext", True

End If

 

 

If objFSO.FolderExists("C:\windows\sun\java\deployment\Lib\Trusted") Then

 

objFSO.MoveFolder "C:\windows\sun\java\deployment\Lib\Trusted", "C:\windows\sun\java\deployment\Lib\Trusted1"  

 

End If

 

WScript.Quit()

 

 

 

 

 


1 Comment   [ + ] Show comment
  • I would suggest posting this in the Blog area rather than the Q&A. Thanks! - mpace 11 years ago

Answers (0)

Be the first to answer this question

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ