Locate and replace a file under User Data

(imported topic written by SystemAdmin)

I have a script made up to install an application, my problem however is trying to distribute a configuration file to each of the users. The program places a user.config file in the following location:

Win XP

C:\Documents and Settings\USERNAME\Local Settings\Application Data\MochaSoft\tn5250.exe_StrongName_r5rg5brdlcmcb0dukofkrllxhfa0nm1k\2.1.0.0\user.confg

Win 7

C:\Users\AppData\USERNAME\AppData\Local\MochaSoft\tn5250.exe_StrongName_r5rg5brdlcmcb0dukofkrllxhfa0nm1k\2.1.0.0\user.config

How could I just replace the current file that is there and over-write it? The USERNAME is different on every machine…

  • ed

(imported comment written by SystemAdmin)

Try using the

Current User

Here’s some examples for using it

http://bigfix.me/cdb/search/~name%20of%20current%20user~?&fixlets=false&analyses=false

(imported comment written by jgstew)

See this example:

((sum of sizes of descendants of folders “AppData\Local\Temp” of folders whose(exists folder “AppData\Local\Temp” of it) of folder “C:\users”) / (1024*1024)) as string & " MB of user temp files"

(imported comment written by jgstew)

sha1s of files “AppData\Local\MochaSoft\tn5250.exe_StrongName_r5rg5brdlcmcb0dukofkrllxhfa0nm1k\2.1.0.0\user.config” of folders whose(exists folder “AppData\Local\MochaSoft\tn5250.exe_StrongName_r5rg5brdlcmcb0dukofkrllxhfa0nm1k\2.1.0.0” of it AND exists file “user.config” of folder “AppData\Local\MochaSoft\tn5250.exe_StrongName_r5rg5brdlcmcb0dukofkrllxhfa0nm1k\2.1.0.0” of it) of folder “C:\users”