Scrip Paste %userprofile%

Hi Team,

I am using below script to paste the .java.policy in to the “%userprofile%” it’s not working through bigfix console

Kindly Help to resolved

delete __appendfile 
appendfile @echo OFF 
appendfile C: 
appendfile xcopy /Y "C:\JavaPolicy\.java.policy" "%userprofile%" 
appendfile Exit 
move __appendfile "C:\JavaPolicy\JavaPolicy.bat" 
waithidden "C:\JavaPolicy\RunAsCurrentUser.exe" --w --q cmd.exe /C "C:JavaPolicy\JavaPolicy.bat"

The client code (and the internal documentation states the client code is shared by this older tool) doesn’t inherit the environment of the user context that we run as, so its very possible that %userprofile% isn’t defined when we run like this.

As a note the newer method is via the override command https://developer.bigfix.com/action-script/reference/execution/override.html

1 Like

Also, if the current user can’t read that location, it will fail.

If you are just copying a file into the current user profile, then you don’t need to do it this way. You can just copy the file as the system account to the current user location that you determine dynamically using relevance.

If you want to enforce JavaPolicy then it shouldn’t go in the current user profile anyway.

thanks ,

can you Provide me the any action script to copy paste JavaPolicy in to the userprofile

it will very helpful for me .