Pages

Thursday, 6 January 2022

Copy File to user profile while installing through system contest

 For /F "tokens=2* delims= " %%u IN ('Reg QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" /V ProfilesDirectory') DO Set ProfilesDir=%%v

Set ProfilesDir=%profilesDir:%%SystemDrive%%=%\%ProfilesDir:~14,100%

For /F "tokens=*" %%d IN ('Dir /ad /b "%ProfilesDir%"') DO (

If /I NOT "%%d" == "ALL USERS" (

xcopy "%~dp0FIlezilla" "%ProfilesDir%\%%d\appdata\Roaming\FileZIlla" /y /e))

No comments:

Post a Comment

test

 # Set the file path you want to check $filePath = "C:\Path\To\Your\File.exe" # Check if file exists if (Test-Path $filePath) {   ...

Search This Blog