Hello,

I made a script to change change the background image within C:\Windows\System32\oobe\info\backgrounds. When the script verifies if the directory exists, it fails. This directory does exist on the target machine and I can manually adjust and edit the specified directory.

Here is what my script looks like:

Output Log

Running as: SYSTEM
Directory does not exist: C:\Windows\System32\oobe\info\backgrounds

Activity Log

Checking if directory exists: C:\Windows\System32\oobe\info\backgrounds

I tested this a few times and it seems that the script can't verify anything past C:\Windows\System32\oobe. I verified the folder properties and it doesn't seem like there is anything that would cause an issue with this script. Any help would be greatly appreciated.

Thanks!

1 Comment   [ + ] Show Comment

Comments

  • I'm experiencing this exact issue. Was a resolution ever found?
Please log in to comment

Answers

1

Can you just move it up to verify? I'm assuming you're adding labels that you want this background on? There's really no reason to verify a directory exists that already exists on every machine.

Are you leaving it running as SYSTEM?

Answered 04/04/2013 by: dugullett
Red Belt

  • The script is being run on two test machines, which are part of a label. I tried running the script as both SYSTEM and the Administrator, both seem to fail. When I ran the script without the verification, it did not place the file in the specified directory. I wanted to add in the verification to troubleshoot and noticed it was not verifying a directory that actually did exist.
    • What directory was it putting it in if any?

      Can you verify you can run this script outside of the Kbox and it copies to this directory?
Please log in to comment
1

I am able to run the script perfectly fine outside the kbox, which has me stumped. It seems that through kbox I can't edit/create any files/directories in C:\Windows\System32\oobe\info\ as if the kbox does not see the info directory for some reason. I am able to run this script through kbox to change anything within C:\Windows\System32\oobe however.

Answered 04/05/2013 by: pregiec
Senior Purple Belt

  • can you post the top half of the script page also
Please log in to comment
1

Heres the full page of the script

Answered 04/05/2013 by: pregiec
Senior Purple Belt

  • cannot add picture, switch to run a program. see my answer I just added for picture
  • I was able to use this script successfully to download the picture on the previous directories.
Please log in to comment
1

Using File Synchronization to acomplish the same task seems to also fail. When trying to download the file to the specified directory it also fails and the file does not appear in the directory.

Answered 04/05/2013 by: pregiec
Senior Purple Belt

Please log in to comment
1

Answered 04/05/2013 by: SMal.tmcc
Red Belt

  • The script works in that it copies the file into the C:\Windows\SysWOW64 directory. The file would need to go into the C:\Windows\System32 directory
  • that makes sense. You should adding the os bit version to questions in the future, a lot of the times the answer will be different for 32 vs 64 due to syswow64 file and hive entires.
  • glad your good, you also would be better to use xcopy vs copy when creating scripts then you do not need to create and upload a batch file.
Please log in to comment
1

After a bit more testing I seemed to have found the problem. It seems that when I specify the following directory:

C:\Windows\System32\oobe\info\backgrounds

The file actually goes to:

C:\Windows\SysWOW64\oobe\info\backgrounds

This would explain why I was not seeing anything within C:\Windows\System32\oobe\info\backgrounds and why the verification failied because \info\backgrounds does not exist in  C:\Windows\SysWOW64\oobe.

The question now would be is how would I get the script to run on the desired directory?

Answered 04/05/2013 by: pregiec
Senior Purple Belt

  • that makes sense. You should adding the os bit version to questions in the future, a lot of the times the answer will be different for 32 vs 64 due to syswow64 file and hive entires.
Please log in to comment
1

How should I set up the script if the currecnt one redirects the destination file to SysWOW64 rather than System32? The goal is to have the file transfered over to the system32 directory, but it keeps redirecting it to the SysWOW64 directory.

Any help would be appreciated.

Answered 04/08/2013 by: pregiec
Senior Purple Belt

  • should be able to use xcopy with the full path instead of variables
    do launch a program
    use
    directory = $(kace_sys_dir)
    file = xcopy.exe
    parameters = $(KACE_DEPENDENCY_DIR)\BACKGROUNDDEFAULT.jpg C:\Windows\System32\oobe\info\backgrounds /q /y
  • When I use the script, it still manages to put the file into SysWOW64 rather than the system32 directory. Would there be any easy way around that?
    • let me test on my 64 bit master. will let you know shortly
      • Any outcome from this?
        Win7x64 seems to redirect the files it believes to be 32 bit into the syswow64 folder regardless of how we coax it not to. Im currently having a similar issue.
  • Old, I know, but I was running into this problem and came across this thread.
    The problem is outlined here: http://www.itninja.com/blog/view/x64-vs-x86-32bit-application-redirects
    If you're on a 64-bit system and want to hit c:\Windows\System32, you have to use c:\windows\sysnative
    • Sorry for necro.

      As we are currently changing our logon background, I thought it might be useful for those in the same boat.

      1. Use a CIR (FileExistsWithMD5(path, MD5value) to check for new logon background. I named it "New Logon Background 2015"

      2. Use a file synchronization for the new logon background (C:\Windows\sysnative\oobe\info\backgrounds) *thanks jones948, forgot about this quirk, you reminded me*

      3. CIR will show new devices with new background.
Please log in to comment
0

As dugullett indicated can you run the script on its own outside the kbox? Under you username and pwd can you go to that direction and create a file/folder there?

 

If you can why not just use file synchronizations from the Distribution module. It can create the directory if its not there using your credentials and then copy your image down to that direction. No need to run a script if its just a copy down. 

 

Answered 04/04/2013 by: nshah
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity

Share