#169399 - 2006-10-14 01:47 AM
Re: Deleting folder contents in users "Documents and Settings "
|
Witto
MM club member
   
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Code:
If NOT @LOGONMODE Break On Else Break Off EndIf Dim $SO $SO = SetOption("Explicit","On") $SO = SetOption("NoMacrosInStrings","On") $SO = SetOption("NoVarsInStrings","On") $SO = SetOption("WrapAtEOL","On")
CreateSpecialFolderVars()
? $AllUsersStartMenu
Function CreateSpecialFolderVars() Dim $OldExplicitOption $OldExplicitOption = SetOption("Explicit","Off") $AllUsersStartMenu = GetSpecialFolders(22)[1] ;2K/XP $OldExplicitOption = SetOption("Explicit",$OldExplicitOption) EndFunction
Function GetSpecialFolders($Folder) Dim $objFolderItem $objFolderItem=CreateObject('Shell.Application').Namespace($Folder).Self $GetSpecialFolders=$objFolderItem.Name,$objFolderItem.Path EndFunction
|
|
Top
|
|
|
|
#169402 - 2006-10-19 10:31 PM
Re: Deleting folder contents in users "Documents and Settings "
|
Lonkero
KiX Master Guru
   
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
which is poor mans version of: Code:
Del "%userprofile%\Oracle Jar Cache\*.*"
|
|
Top
|
|
|
|
#169403 - 2006-10-23 12:33 PM
Re: Deleting folder contents in users "Documents and Settings "
|
craigs9
Fresh Scripter
Registered: 2006-07-05
Posts: 22
Loc: London, UK
|
Quote:
You should never use a username or @UserID macro as part of the profile path.
Why is that? How should you go about it then?
|
|
Top
|
|
|
|
#169404 - 2006-10-23 12:48 PM
Re: Deleting folder contents in users "Documents and Settings "
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
Why is that?
Because while it will work most of the time, it will not work all of the time.
For various reasons Windows may decide to append ".001" or the domain name to the local profile. One common cause is permissions problems.
|
|
Top
|
|
|
|
#169405 - 2006-10-23 12:56 PM
Re: Deleting folder contents in users "Documents and Settings "
|
craigs9
Fresh Scripter
Registered: 2006-07-05
Posts: 22
Loc: London, UK
|
Hadn't thought of that happening but have seen it happen a few tiems I supose. So %userprofile% will still work even if the local profile path changes? (i.e. it adds the doamin on to the end?)
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1471 anonymous users online.
|
|
|