Copy file to UserProfile

Post Reply
Boutta
Posts: 5
Joined: 29. Mar 2021, 10:09
Contact:

Copy file to UserProfile

Post by Boutta » 29. Mar 2021, 15:10

Hi,

I want copy file to UserProfile but doesn't work.

Sujet: Copy 1 image to UserProfile\appdata\....Uploads
UNC: %USERPROFILE%\AppData\Roaming\Microsoft\Teams\Backgrounds\Uploads

Setup.ini:
%SRC%\FILES\*" "%USERPROFILE%\AppData\Roaming\Microsoft\Teams\Backgrounds\Uploads"

I try with %SRC%\FILES\*" "c:\Temp"
That OK :)

I try with %WindowsUser% and %OsLogin% doen't work :(

I need your help please.

Sincerly,

Boutta

User avatar
ctearney
Posts: 225
Joined: 21. Feb 2014, 04:14
Location: Dallas, Texas
Contact:

Re: Copy file to UserProfile

Post by ctearney » 29. Mar 2021, 22:38

when we want to build a package that copies a file to a user profile or run an executable under the user context we always add a step to the setup.inf that stages the files we are wanting to work with to a directory on the local machine that all users have access to first. For example, in our baseline image we create a folder on the root of C: called "Company" and set the permissions to it so that all "authenticated users" have full control of the folder.

In the inf file we add a machine copy section which copies the needed files from %SRC% to this location. Then we add a section to the inf file for "Client" which will execute or copy those files using the user context.

So you will have something like this.

#Set:Stage User Files, MACHINE DONTDELETE
#Set:Client Config, CLIENT DONTDELETE

The "Stage Users Files" section will copy the needed files to the local directory you create and then the "Client Config" section will execute the action using that directory as the new source. For example:

[Set:Stage User Files]
1:%Src%\1PasswordSetup-7.6.780.exe, C:\Company\1PasswordSetup-7.6.780.exe

[Set:Client Config]
AddMeter -1
Call "C:\Company\1PasswordSetup-7.6.780.exe" --silent
If "%ErrorLevel%" <> "0" Then "SET:InstallationError" EndIf

Boutta
Posts: 5
Joined: 29. Mar 2021, 10:09
Contact:

Re: Copy file to UserProfile

Post by Boutta » 30. Mar 2021, 16:01

Hi,

Thank for your reply.

I try:

[Create Folder]
MkDir "C:\Temp\Fond_Teams" >>>> OK

[Copy SRC]
Copy "%SRC%\Files\*" "C:\Temp\Fond_Teams" >>>>> OK

[Copy Fond_Teams]
Copy "C:\Temp\Fond_Teams\*" "%USERPROFILE%\AppData\Roaming\Microsoft\Teams\Backgrounds\Uploads" >>>> doesn't work. :(

Maybe i'm not doing the right things.

User avatar
Hendrik_Ambrosius
Moderator
Moderator
Posts: 7962
Joined: 13. Dec 2004, 23:10
Location: Adendorf/Lüneburg

Re: Copy file to UserProfile

Post by Hendrik_Ambrosius » 13. Apr 2021, 14:33

Does that last command run in the user part?
The call should look like this:
#Copy Fond_Teams,CLIENT
Hendrik Ambrosius / Senior Presales Consultant
Mobile: +49 172 408 4447 | hendrik.ambrosius@matrix42.com
Matrix42 GmbH | Elbinger Straße 7 | 60487 Frankfurt am Main | Germany | www.matrix42.com

Disclaimer: I participate in this forum on a voluntary basis. Views expressed are not necessarily those of Matrix42 or of the support team.

Boutta
Posts: 5
Joined: 29. Mar 2021, 10:09
Contact:

[RESOLVE]Re: Copy file to UserProfile

Post by Boutta » 04. Aug 2022, 12:27

Hello,

It was a legal issue.

it was necessary to copy the images in a folder having access to then copied them in %appdata%.

Boutta

Post Reply

Return to “Packaging”

Who is online

Users browsing this forum: No registered users and 3 guests