Application wait for Windows profile to be created
I have a WPF VB.NET 3.5 application which we have set to run at login via GPO (Windows 7, AD 2003/2008), when this application runs on user login I finding that it is failing when the user has n开发者_JAVA百科ot logged into the PC before and the profile needs to be created.
In our environment we use redirected folders to point folders such as Favorites and AppData (Global) to a network share. My application copies files and folders to these redirected folders. When my application is processing the folder and file copy code, I am seeing exceptions appear in my log file that the folder doesn't exist.
I have added the following bits of code to the top of my Window_Loaded method, which checks that the drives exist, and thinking that explorer runs when the profile has been created, I have also put in a check that this process exists.
Do Until checkProcessRunning("Explorer") = True AND _
Directory.Exists("U:\") AND Direcotry.Exists("S:\")
Thread.Sleep(100)
Loop
However, even with this in place I am still experiencing the issue of folders not being present.
One such folder I need is %AppData%\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
. The Exception I am getting is Could not find part of the path
.
What I am hoping for is some guidance or suggestions on how people have overcome this type of problem in the past, or what I am I missing, am I heading in the right direction or completely missing the mark?
Greatly appreciate any assistance given.
Matt
精彩评论