New
#1
VBS error
Hi guys, I hope Im putting this in the right place...
I've got a script that I'll be including to my pre-sysprep scripts...
Basically, I need it to change the folder permissions on the \oobe\info\backgrounds\ folder so I can copy out company image there. Custom logon background...
However, im getting a funky error message:My Script is:Code:Script: W:\exists.vbs Line: 27 Char: 1 Error: Permission denied Code: 800A0046 Source: Microsoft VBScript Runtime errorI know the actual image is meant to be named BackgroundDefault.jpg, but this is for testing at the moment...Code:strFolderInfo = "C:\windows\system32\oobe\info\backgrounds" strImageFile = "W:\images\Win7\files\images\background.jpg" Set myFSO = CreateObject("Scripting.FileSystemObject") Set mySHL = CreateObject("WScript.Shell") if not myFSO.FolderExists(strFolderInfo) then myFSO.CreateFolder(strFolderInfo) WScript.Echo("Create Info Folder") else WScript.Echo("Folder already Exists") end if intRunError = mySHL.Run("%COMSPEC% /c Echo Y| cacls " & strFolderInfo & " /t /c /g Everyone:F ", 2, True) If intRunError <> 0 Then Wscript.Echo "Error assigning permissions for " & strHomeFolder End If intRunError2 = mySHL.Run("%COMSPEC% /c Echo Y| attrib -R " & strFolderInfo,2,TRUE) If intRunError2 <> 0 Then Wscript.Echo "Error Applying Attributes " & strUser & " to home folder " & strFolderInfo End If <line 27> intCopyError = myFSO.CopyFile(strImageFile, strFolderInfo, True) If intCopyError <> 0 Then WScript.Echo("Error: " & intCopyError) Else WScript.Echo("Background Image Copied.") End If
Also, the <line 27> is not in the script, its just for your quick reference.
W:\ is a mapped network share
Can someone point me in the right direction as to why this is not working as expected?