Opsiscript copy
Opsiscript copy
Guten Morgen liebes Opsi Forum,
im opsiscript kann man ja mit folgender Zeile, verschiedene Dinge vor oder nach der Installation kopieren:
[Files_copy_local]
copy "%SCRIPTPATH%\files1\$File$" C:\Program Files\xyz
Wie würde das denn im jeweiligen Benutzerverzeichnis aussehen?
Als Beispiel:
C:\Users\xyz\AppData\Roaming\xyz
Ich hab schon mehrere Sachen probiert, aber bis jetzt hat nichts geklappt.
copy "%SCRIPTPATH%\files1\$File$" C:\Users\%username%\AppData\Roaming\Docusnap
copy "%Scriptpath%\files1\$File$" "%CurrentAppdataDir%\Docusnap"
im opsiscript kann man ja mit folgender Zeile, verschiedene Dinge vor oder nach der Installation kopieren:
[Files_copy_local]
copy "%SCRIPTPATH%\files1\$File$" C:\Program Files\xyz
Wie würde das denn im jeweiligen Benutzerverzeichnis aussehen?
Als Beispiel:
C:\Users\xyz\AppData\Roaming\xyz
Ich hab schon mehrere Sachen probiert, aber bis jetzt hat nichts geklappt.
copy "%SCRIPTPATH%\files1\$File$" C:\Users\%username%\AppData\Roaming\Docusnap
copy "%Scriptpath%\files1\$File$" "%CurrentAppdataDir%\Docusnap"
- SisterOfMercy
- Beiträge: 1524
- Registriert: 22 Jun 2012, 19:18
Re: Opsiscript copy
It's not that difficult, if one would have taken a look in the opsi-script manual
Also, don't use stuff like "C:\Program Files\xyz", especially without quotes.
Use one of these snippets:
or
Code: Alles auswählen
Files_install /SysNative
Files_install_AllProfiles /AllNtUserProfiles
[Files_install_64]
; Example of recursively copying some files into the installation directory:
copy -s "%ScriptPath%\files\*.*" "$InstallDir64$"
[Files_install_AllProfiles]
; Example of recursively copying some files into each user profile directory:
copy -s "%ScriptPath%\files\*.*" "%UserProfileDir%"
Use one of these snippets:
Code: Alles auswählen
DefVar $InstallDir64$
Set $InstallDir64$ = "%ProgramFiles64Dir%\xyz"
Code: Alles auswählen
copy "%SCRIPTPATH%\files1\$File$" "%ProgramFiles64Dir%\xyz"
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
-
- Beiträge: 44
- Registriert: 05 Nov 2015, 11:26
Re: Opsiscript copy
Zunächst musst du die File-Selektion mit /AllUserProfiles deklarieren:
https://download.uib.de/opsi_stable/doc ... ript-files
und deine Pfade mit den opsi-script variabeln versehen:
https://download.uib.de/opsi_stable/doc ... st-system1
z.B:
Files_Copy /AllUserProfiles
[Files_Copy]
copy "%SCRIPTPATH%\files1\$File$" "%ProfileDir%\AppData\Roaming\Docusnap"
https://download.uib.de/opsi_stable/doc ... ript-files
und deine Pfade mit den opsi-script variabeln versehen:
https://download.uib.de/opsi_stable/doc ... st-system1
z.B:
Files_Copy /AllUserProfiles
[Files_Copy]
copy "%SCRIPTPATH%\files1\$File$" "%ProfileDir%\AppData\Roaming\Docusnap"
- SisterOfMercy
- Beiträge: 1524
- Registriert: 22 Jun 2012, 19:18
Re: Opsiscript copy
Not %ProfileDir%, this is something else.Patrick89bvb hat geschrieben: ↑25 Apr 2022, 14:29 [Files_Copy]
copy "%SCRIPTPATH%\files1\$File$" "%ProfileDir%\AppData\Roaming\Docusnap"
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
-
- Beiträge: 44
- Registriert: 05 Nov 2015, 11:26
Re: Opsiscript copy
But this varable copy in all exciting user-profil...
Re: Opsiscript copy
Hi,
%UserProfileDir% in combination with switch /AllUserProfiles
Diese Konstante wird nur innerhalb von Files-Sektionen, die mit der Option /AllUserProfiles aufgerufen werden, interpretiert. Sie wird dann der Reihe nach belegt mit dem Namen des Profil-Verzeichnisses der, verschiedenen auf dem System, existierenden Nutzer.
Der Parameter /AllUserProfiles existiert seit 4.12.4.27. Noch gültig aber nicht mehr empfohlen ist das alte sysnonym /AllNTUserProfiles.
https://download.uib.de/4.2/documentati ... sercontext
In Files sections that are called with option /AllUserProfiles there is a pseudo variable
%UserProfileDir%
When the section is executed for each user that exists on a work station this variable represents the name of the profile directory of the user just treated.
The parameter /AllUserProfiles exits since 4.12.4.27. The use of the older and still working synonym /AllNTUserProfiles is discouraged.
https://download.uib.de/4.2/documentati ... anual.html
%UserProfileDir% or %CurrentProfileDir%
NT6: c:\users\%USERNAME%
whereas
%ProfileDir% :
NT6: C:\users\
%UserProfileDir% in combination with switch /AllUserProfiles
Code: Alles auswählen
"%UserProfileDir%\AppData\Roaming\Docusnap"
Der Parameter /AllUserProfiles existiert seit 4.12.4.27. Noch gültig aber nicht mehr empfohlen ist das alte sysnonym /AllNTUserProfiles.
https://download.uib.de/4.2/documentati ... sercontext
In Files sections that are called with option /AllUserProfiles there is a pseudo variable
%UserProfileDir%
When the section is executed for each user that exists on a work station this variable represents the name of the profile directory of the user just treated.
The parameter /AllUserProfiles exits since 4.12.4.27. The use of the older and still working synonym /AllNTUserProfiles is discouraged.
https://download.uib.de/4.2/documentati ... anual.html
%UserProfileDir% or %CurrentProfileDir%
NT6: c:\users\%USERNAME%
whereas
%ProfileDir% :
NT6: C:\users\
Re: Opsiscript copy
Danke für die Hilfe.
Hab es hiermit umgesetzt:
Hab es hiermit umgesetzt:
Code: Alles auswählen
Files_Copy /AllUserProfiles
[Files_Copy]
copy "%SCRIPTPATH%\files1\$File$" "%UserProfileDir%\AppData\Roaming\Docusnap"