Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Renaming multiple instances of a file

4 views
Skip to first unread message

Sean Dunn

unread,
Feb 25, 2004, 1:37:38 AM2/25/04
to
Hello, I'm upgrading Norton Antivirus on all my windows
2000 Professional desktops. And I have to rename the
extend.dat file for every profile on each Workstation.
extend.dat is located at c:\documents and settings\
%username&\localsettings\ApplicationData\Microsoft\outlook
If there were just one profile on the workstation, I
could figure it out but I have multiple profiles on each
client. Any help would be appreciated. --Thanks Sean

Torgeir Bakken (MVP)

unread,
Feb 25, 2004, 11:59:44 AM2/25/04
to
Sean Dunn wrote:

Hi

For a remote way of doing it if you can use the admin share (c$), take
a look here for a starting point:

http://groups.google.com/groups?selm=3FE2371C.6E5E6DE9%40hydro.com


For a local version, here is a starting point:


Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

On Error Resume Next
strProfilesDirectory = "" 'init value
strProfilesDirectory = objShell.RegRead("HKLM\SOFTWARE\Microsoft\" _
& "Windows NT\CurrentVersion\ProfileList\ProfilesDirectory")
On Error Goto 0

If strProfilesDirectory = "" Then
' The ProfilesDirectory registry value didn't exist,
' parsing the "Common Start Menu" path read from registry instead
strCSMpath = objShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\" _
& "CurrentVersion\Explorer\Shell Folders\Common Start Menu")
' Remove the "\All Users\Start Menu" part of it
strProfilesDirectory = Left(strCSMpath, Len(strCSMpath) -21)
End If

strProfilesDirectory = objShell.ExpandEnvironmentStrings(strProfilesDirectory)
WScript.Echo "Users profile folders:" & vbCrLf

' enumerate the folders
Set objFolder = objFSO.GetFolder(strProfilesDirectory)
For Each objFldr In objFolder.SubFolders
WScript.Echo objFldr.Path
Next


--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter


0 new messages