/build/static/layout/Breadcrumb_cap_w.png

Converting Post Installation Task to Online Shell Script

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
  • I'm not positive, but I think that the /y flag on copy needs to come before the files. - chucksteel 7 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