|
|
|||||||
I need to check in my logon script to see if the user has MS Word, then copy a file to their user directory. I can't seem to figure out how to check user specific. I have tried many combinations of the if statement. If Exist ("C:\Documents and Settings\"+@userid+"\Application Data\Microsoft\Templates\Normal.dot") copy @lserver+"\netlogon\Normal.dot" "C:\Documents and Settings\"+@userid+"\Application Data\Microsoft\Templates\" Endif |
||||||||
|
|
|||||||
You should never embed @UserID in the path but rather pull the path from the registry. The reason and method has been discussed here many times. |
||||||||
|
|
|||||||
OK, can you give a hint? |
||||||||
|
|
|||||||
A little example. You could also use the environment variable %appdata%. Code: Break on $appdata = ReadValue("HCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "AppData") If Exist ($appdata + "\Microsoft\Templates\Normal.dot") Copy @lserver+"\netlogon\Normal.dot" $appdata + "\Microsoft\Templates\" EndIf |
||||||||
|
|
|||||||
Thanks for the info. I think you have pointed me on the right track. |