I would like to convert the a K2000 task to a K1000 script.  I simplified things down to a simple copy command and receive the same Error 1 when trying to copy/move files around Windows folder.  I can't seem to work around the permissions contraints.  Your suggestions on fixing things and also additional reads on how KACE handles privileges when running scripts are appreciated.

K2000 Task I'd like to create as script.

@ECHO OFF
set "screenheight="
set "screenwidth="

::COLLECT SCREENHEIGHT
for /F "tokens=2 delims==" %%F in ('wmic desktopmonitor get screenheight /value') do (
    if not defined screenheight set screenheight=%%F
)

::COLLECT SCREENWIDTH
for /F "tokens=2 delims==" %%F in ('wmic desktopmonitor get screenwidth /value') do (
 
    if not defined screenwidth set screenwidth=%%F
)

IF NOT %screenheight%=="" (

del C:\Windows\System32\oobe\info\backgrounds\backgroundDefault.jpg
copy C:\Windows\Web\Wallpaper\%screenwidth%x%screenheight%.jpg C:\Windows\System32\oobe\info\backgrounds\
rename C:\Windows\System32\oobe\info\backgrounds\%screenwidth%x%screenheight%.jpg backgroundDefault.jpg

)

Simplified Shell Script that fails

copy c:\users\backgrounddefault.jpg c:\windows\system32\oobe\info\backgrounds /y

1 Comment   [ + ] Show Comment

Comments

  • I'm not positive, but I think that the /y flag on copy needs to come before the files.
Please log in to comment

There are no answers at this time

Answers

Answer this question or Comment on this question for clarity