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:
I know the actual image is meant to be named BackgroundDefault.jpg, but this is for testing at the moment...
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?
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:
Code:
Script: W:\exists.vbs
Line: 27
Char: 1
Error: Permission denied
Code: 800A0046
Source: Microsoft VBScript Runtime error
My Script is:
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
[B]<line 27>[/B] 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?
My Computer
- OS
- Windows 7 Enterprise
- CPU
- Intel Pentium Dual E2200 @2.2GHz
- Motherboard
- Gigabyte II-G31
- Memory
- 4GB
- Graphics Card(s)
- Palit GForce 9500GT 1GB
- Sound Card
- onBoard
- Hard Drives
- WesternDigital: 250GB + 1TB + 1TB + 2TB
- PSU
- 450W
- Case
- CoolerMaster CM690
- Cooling
- Corsair H50
- Mouse
- Logitech MX518
