Jump to content

Any why to tell where users my docs redirected to?


truwarrior

Recommended Posts


Look at the following registry key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

The value of "Personal" will tell you where they have their MyDocs going.

Good idea, not sure if there is away to automaticlly export it in a logon script, but since I only have about 200 users, it would work. Thanks!

Link to comment
Share on other sites

All you need is a share that all users have write access to...they don't even need to know it's there. Have the logon script append the information to a text file.

What scripting language is your logon scripts written in?

Edited by nmX.Memnoch
Link to comment
Share on other sites

All you need is a share that all users have write access to...they don't even need to know it's there. Have the logon script append the information to a text file.

What scripting language is your logon scripts written in?

Just a basic command line .bat file.

I guess I would have to use the reg command to export a key and append to a text file that way?

Link to comment
Share on other sites

You really should look into using KiXtart for your logon scripts. It's free and was originally designed for just that purpose.

I'll get you started with a script to read the key and append the information to a text file...just give me some time to create it. I'll post here when it's done.

Link to comment
Share on other sites

You really should look into using KiXtart for your logon scripts. It's free and was originally designed for just that purpose.

I'll get you started with a script to read the key and append the information to a text file...just give me some time to create it. I'll post here when it's done.

Thanks for the link. I’ll look into that as a substitute. I appreciate all your help!

Link to comment
Share on other sites

No problem. I've got the script done. :)

Create a blank mydocs.kix file (standard txt file with a different extension) and past the code below into it. You'll need KIX32.EXE available to all of the machines...but you can just place this in your NETLOGON share and call it from there. To call the KIX script from your logon script just add the following to your logon script:

%0\..\KIX32.EXE %0\..\mydocs.kix

If you don't want the users to see it running then use WKIX32.EXE with a /i switch like so:

%0\..\WKIX32.EXE /i %0\..\mydocs.kix

You'll need to create a share (hidden or not, up to you) that they have write access to. Download the attached mydocs.txt and rename it to mydocs.csv. Place the mydocs.csv on the share. Update the $FILE variable in the code below to point to the share you create. Using a CSV file will allow you to open the file directly in Excel.

The information should only be written to the CSV file once.

$FILE = "\\server\share$\mydocs.csv"

If Open(1,"$FILE",2) = 1
$LINE = ReadLine(1)
While @ERROR = 0
If InStr($LINE,@WKSTA)
$X = "Yes"
EndIf
Loop
Close(1)
EndIf

If $X = "Yes"
? "Information already written to file"
Else
If Open(1,"$FILE",5) = 1
$MyDocs = ReadValue("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","Personal")
? "Writing information to file"
WriteLine(1,@WKSTA + "," + @uSERID + "," + @DATE + "," + @TIME + ",$MyDocs," + @CRLF)
Close(1)
EndIf
EndIf

Should you decide that you want to completely move your logon scripts to KIX I'll be more than happy to help. I also recommend that you look into a good editor such as AdminScriptEditor or PrimalScript. I use both but personally prefer AdminScriptEditor for KIX.

mydocs.txt

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...