<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I’ve been trying to copy images to a folder within System32 and then rename one of them.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I created one package responsible to copy the images to the path and then rename one file.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The copying works. Since I’m using xcopy the missing folders are being generated automatically.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I can see, that the files have been copied correctly and rename them using the explorer.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">However any attempt of renaming one file afterwards failed.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Strangely this seems to only happen when using wpkg.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">When trying to execute it manually using cmd it works just fine.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Whenever using wpkg I get the “The system cannot find the path specified” error.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I tried to run the package multiple times to ensure that the images are properly copied.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I tried to run the package without the xcopy command to make sure the files are not in use.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Those were not the issue.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Below I will include the code snippets I used without the boilerplate package structure or checks:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><install cmd='xcopy "%RESOURCES%\images\*" "%windir%\System32\oobe\info\backgrounds" /y /i /q /r' /><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><install cmd='rename "%windir%\System32\oobe\info\backgrounds\old_filename.jpg" backgroundDefault.jpg ' /><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">%RESOURCES% links to the folder which includes the images that have to be copied.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Best<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:3.0pt"><b><span style="color:#00214E;mso-fareast-language:DE">Jan-Niklas Nowak</span></b><b><span style="mso-fareast-language:DE"><br>
</span></b><span style="mso-fareast-language:DE">Auszubildener zum<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:3.0pt"><span style="mso-fareast-language:DE">Fachinformatiker<br>
Anwendungsentwicklung<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:3.0pt"><span style="mso-fareast-language:DE"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:3.0pt"><span lang="EN-US" style="mso-fareast-language:DE">Business Line Mobility
<br>
<span style="color:#A6A6A6">______________________________________________</span><br>
Telefon: +49 231 5599-8125<br>
E-Mail: jan.nowak@materna.de<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;color:gray;mso-fareast-language:DE">Materna GmbH | Voßkuhle 37 | D-44141 Dortmund | Germany<br>
Geschäftsführer: Helmut Binder, Ralph Hartwig<br>
Amtsgericht Dortmund HRB 5839</span><span style="mso-fareast-language:DE"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>