Re: Rename folders? by TDM
TDM
Tue Sep 30 12:26:31 CDT 2003
The method I chose was to "copy" the profile to "Default User", that way
you still have the old profile around if there are problems. This will only
work if the user is not logged in, which is of course true for the
move/rename
as well. I thought it also wise to make a make a backup copy of the standard
"Default User" profile before the copy, then put it back after the user
logged
in. Otherwise, all users logging in to that macine will get "that users"
profile
which is perhaps OK in some situations. If you have admin rights to the
machine
you can do all this remotely as well.
My $.02 worth.
TDM
"Greg S. Blackman" <groggrog@comcast.net> wrote in message
news:3F784931.2030907@comcast.net...
> Nathan, did you ever get this working? I'm trying to do something
> similar and would appreciate knowing how you got this working.
>
> Thanks
>
>
>
>
> Nathan Guidry wrote:
> > Valiant effort, but it didn't work. I need to find a way to rename a
user's
> > profile to default user. That way when they log on again with a new
naming
> > convention, they'll get their profile.
> > "Rob Wiltbank" <wynder@warcry.com> wrote in message
> > news:#BggJm7SDHA.1576@TK2MSFTNGP12.phx.gbl...
> >
> >>Try this.. Stick the new name into a variable...
> >>
> >>strNewName = "C:\Documents and Settings\Default User"
> >>
> >>Then use it.
> >>
> >>objFolder.Rename(strNewName)
> >>
> >>That's just off the top of my head.
> >>
> >>Rob
> >>
> >>
> >>
> >>> errResults = objFolder.Rename("C:\documents and settings\default
> >
> > old")
> >
> >>>The problem is the "documents and settings" part of the script. It
> >>
> >>doesn't
> >>
> >>>seem to like the spaces in the folder name. I alievated part of the
> >>
> >>problem
> >>
> >>>by using %userprofile%, but I need to rename that folder to 'default
> >>
> >>user'.
> >>
> >>>Any suggestions.
> >>>"Rob Wiltbank" <wynder@warcry.com> wrote in message
> >>>news:OLmRq$6SDHA.3796@tk2msftngp13.phx.gbl...
> >>>
> >>>>Looks like it's the strComputer variable -- should be:
> >>>>strComputer = "."
> >>>>
> >>>>This variable is used in connecting to the machine with GetObject in
> >
> > the
> >
> >>>>next line. The "." means the local PC.
> >>>>
> >>>>Rob
> >>>>
> >>>>
> >>>>>strComputer = ""
> >>>>>Set objWMIService = GetObject("winmgmts:" _
> >>>>> & "{impersonationLevel=impersonate}!\\" & strComputer &
> >>>
> >>>"\root\cimv2")
> >>>
> >>>>
> >>>
> >>
> >
> >
>