Copy file to UserProfile

Antworten
Boutta
Beiträge: 4
Registriert: 29. Mär 2021, 10:09
Kontaktdaten:

Copy file to UserProfile

Beitrag von Boutta » 29. Mär 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

Benutzeravatar
ctearney
Beiträge: 200
Registriert: 21. Feb 2014, 04:14
Wohnort: Dallas, Texas
Kontaktdaten:

Re: Copy file to UserProfile

Beitrag von ctearney » 29. Mär 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
Beiträge: 4
Registriert: 29. Mär 2021, 10:09
Kontaktdaten:

Re: Copy file to UserProfile

Beitrag von Boutta » 30. Mär 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.

Antworten

Zurück zu „Packaging“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast