[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

Startup folder in .NET

peter.mcclymont@gmail.com

10/13/2008 1:58:00 AM

Hi All,

Within our application is some configuration which allows the user to
add a link into the startup folder. That of course will mean our
application would then start automatically when windows starts.

We are using .NET 3.5 C#. So I am using this C# code to get the
startup folder path,

Environment.GetFolderPath(Environment.SpecialFolder.Startup)

That works on my local development machines (windows 2008 server and
vista). But it does not work on our build server, what I mean is it
actually returns an empty string on our build server.

It used to work on our old build server (windows 2003) but when I
rebuilt our build server using windows 2008 it didn't work.

Any ideas? Is it the case that when the startup folder has not been
used before something within the OS has not been initialised?
1 Answer

Phil Wilson

10/13/2008 5:22:00 PM

0

This kind of thing depends on the account you're running with (I don't think
SYSTEM has a profile) and whether you're impersonating (which by default
does not load registry hive data for that user). If it's an account which
has never interactively logged on then maybe those folders have never been
set up. It will also depend on whether anyone actually logs on or not. The
Startup folder is not run when Windows starts (for which you need a service)
but when logon occurs.
--
Phil Wilson

"bob laughland" <peter.mcclymont@gmail.com> wrote in message
news:dcd836f1-abf5-4306-a922-b9ac1c8d7fad@f37g2000pri.googlegroups.com...
> Hi All,
>
> Within our application is some configuration which allows the user to
> add a link into the startup folder. That of course will mean our
> application would then start automatically when windows starts.
>
> We are using .NET 3.5 C#. So I am using this C# code to get the
> startup folder path,
>
> Environment.GetFolderPath(Environment.SpecialFolder.Startup)
>
> That works on my local development machines (windows 2008 server and
> vista). But it does not work on our build server, what I mean is it
> actually returns an empty string on our build server.
>
> It used to work on our old build server (windows 2003) but when I
> rebuilt our build server using windows 2008 it didn't work.
>
> Any ideas? Is it the case that when the startup folder has not been
> used before something within the OS has not been initiali