Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making a logon script enter a username

Status
Not open for further replies.

Hellooooooooo

Technical User
Oct 21, 2005
66
GB
Hello Everyone.

I'm wanting to change the default location the outlook 03 uses to store opened attachment for each loged on user.

Iv'e found the Registry entry that I need to alter:

strKey="HKCU\Software\Microsoft\Office\11.0\Outlook\Security\OutlookSecureTempFolder"

objShell.RegWrite strKey, "D:\Documents And Settings\%UserName%\Local Settings\Temporary Internet Files", "REG_EXPAND_SZ"

I have a logon script in vbs that sets loads of settings on logon. Im stuck now, Ive changed the Drive to D:, however I can tink how to get the %UsernName% to pick up the current loggen on user. With out this it's doing me head in.

Is there a simple way to get the script to entry the current user into the %Username% field, so that each user will have a folder created on the D: with the outlook attachment saved to it.

Due to some great legacy software, I cant change to default user profile location the the D:

Any pointers whould be grand.

Cheers

Marty
One for the scrip gods out there i think.

Cheers

Marty
 
Hello Dan.

I've not been back into our office since my last post. Doing fibre pulling in not very dry or clean ducts this week. I have had a look at the link you sent. did a wander around the interweb and came up with this:

dim wsh
set wsh = createobject("WScript.Shell")
login_name = wsh.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Logon User Name")

src = "C:\documents and settings\" & login_name & "\Favorites"

Now all i need to do is get this into my vbs script and call the logon user name into the temp outlook path on the D:

Like I said, I'm not the best a scripts. If you were to see the logon scrip you would laugh.

Thanks for the pointer, and I will let you know how I get on if I can get this god forsaken site online this side of Xmas

Cheers mate.

Marty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top