celestialguy
09-14-2009, 07:25 PM
Hello all! I'm new to this forum and editing/tweaking registry in general. I hope you can help me on this problem. Is it possible to customize the 'Name' sort order in detail? The highlighted red box in the picture below.
http://i11.photobucket.com/albums/a174/celestialguy/th_sample2.jpg (http://s11.photobucket.com/albums/a174/celestialguy/?action=view¤t=sample2.jpg)
What I want to do is to ignore the numbers and parenthesis and sort in alphabetical order.
Example Current windows xp pro setting:
[2006.6.20] Yuka
[2007.8.01] AJISAI
[2008.9.10] Taro Hakase
What I want (alphabetical order):
[2007.8.01] AJISAI
[2008.9.10] Taro Hakase
[2006.6.20] Yuka
If the above is not clear enough please tell me. I will try my best to explain it.
Thank you!
carlobee
09-15-2009, 10:17 AM
so it does sort your files currently basing on the number?
http://storeyourpicture.com/images/signature_pctools.jpg
celestialguy
09-15-2009, 07:07 PM
so it does sort your files currently basing on the number?
http://storeyourpicture.com/images/signature_pctools.jpg
Yes, currently it sorts base on numbers like it should be. But I want it to just sort in alphabetical order.
Jackie12
12-10-2009, 02:20 PM
did you find an answer to this? I was looking for the same thing
josefz
12-18-2009, 02:30 PM
Hi, here is a workaround (as a christmas gift):
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''
' Sort_Order.vbs - a Visual Basic Script (VBScript):
' A workaround attempt for http://www.pctools.com/forum/showthread.php?t=59648
'
' Creates shortcuts to files found within a folder (source_folder);
' if a file name is "[numbers] name.ext" (including brackets), then
' shortcut is named "name [numbers].ext.lnk".
' Shortcuts are created and saved to a folder (target_folder).
' Existing shortcuts of the same name are overwritten.
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''
' USAGE:
' wscript Sort_Order.vbs [source_folder [target_folder]]
' source_folder: if omitted, then the folder containig the script
' target_folder: if omitted, then source_folder\Sort_Order
'
' HINT#1: Drag any folder and drop it to script file to provide source_folder.
' HINT#2: Drag any file and drop it to script file to provide dragged file parent folder as source_folder.
' HINT#3: Place the script into your SendTo folder; then right click any file or folder, choose SendTo and then the script.
' If an argument is specified, then appropriate folder has to exist.
' If target_folder is not specified as 2nd argument, then appropriate folder may be created, if necessary
' You can specify the same source_folder and target_folder.
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''
' © 2009 JosefZ, http://www.pctools.com/forum/member.php?u=16939
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''
option explicit
On Error Goto 0
Const CharToSplit = "]" ' one or more character(s)
Dim intCharLen: intCharLen = Len( CharToSplit)
Dim objFSO: Set objFSO = WScript.CreateObject( "Scripting.FileSystemObject")
Dim WshShell: Set WshShell = WScript.CreateObject( "WScript.Shell")
Dim iii, nnn _
, sMsg, sFldrSource, sFldrTarget _
, oFolderS, oFolderT
Dim objArgs: Set objArgs = WScript.Arguments
nnn = objArgs.Count ' # of arguments passed to script
If nnn >= 1 Then
' source_folder name passed as first argument
sFldrSource = objFSO.GetAbsolutePathName( Trim( objArgs( 0)))
Else
' source_folder name not passed as an argument; get path to script
sFldrSource = objFSO.GetAbsolutePathName( Left( WScript.ScriptFullName _
, ( Len( WScript.ScriptFullName) - - ( Len( WScript.ScriptName) + 1)))) 'Path to script
End If
sMsg = "Source folder " & sFldrSource
If objFSO.FolderExists( sFldrSource) Then
sMsg = sMsg & " exists." & vbNewLine '' Folder exists
Else
If objFSO.FileExists( sFldrSource) Then
Set oFolderS = objFSO.GetFile( sFldrSource)
sFldrSource = objFSO.GetAbsolutePathName( oFolderS.ParentFolder)
Set oFolderS = Nothing
sMsg = "Source folder " & sFldrSource & " exists." & vbNewLine '' Folder exists
Else
sMsg = sMsg & " doesn't exist. Finished, nothing done."
Wscript.Echo sMsg
Wscript.Quit
End If
End If
sFldrSource = sFldrSource & "\"
sMsg = sMsg & "Target folder "
If nnn >= 2 Then
' Target_folder name passed as second argument
sFldrTarget = objFSO.GetAbsolutePathName( Trim( objArgs( 1)))
If objFSO.FolderExists( sFldrTarget) Then
' Target folder exists
Else
' Target folder name provided, but folder doesn't exist. Failure.
sMsg = sMsg & sFldrTarget & " doesn't exist. Finished, nothing done."
Wscript.Echo sMsg
Wscript.Quit
End If
Else
' Target_folder name not passed as second argument
sFldrTarget = objFSO.GetAbsolutePathName( _
sFldrSource & objFSO.GetBaseName( WScript.ScriptName))
End If
If objFSO.FolderExists( sFldrTarget) Then
' Target folder exists
sMsg = sMsg & sFldrTarget & " exists." & vbNewLine
Else
' Target folder doesn't exist. Create it.
Set oFolderT = objFSO.CreateFolder( sFldrTarget)
sMsg = sMsg & sFldrTarget & " created." & vbNewLine
Set oFolderT = Nothing
End If
sFldrTarget = sFldrTarget & "\"
Set oFolderT = objFSO.GetFolder( sFldrTarget)
Set oFolderS = objFSO.GetFolder( sFldrSource)
Dim colFilesS: set colFilesS = oFolderS.Files
Dim fff, oShellLink, sFileOldName, sFileNewName
For Each fff in colFilesS
sFileOldName = fff.name
sFileNewName = FileNName( sFileOldName)
sMsg = sMsg & "'" & sFileOldName & "' '" & sFileNewName & "'" & vbNewLine
' Create a shortcut
set oShellLink = WshShell.CreateShortcut( sFldrTarget & sFileNewName & ".lnk")
' Define properties of a shortcut
oShellLink.TargetPath = sFldrSource & sFileOldName
oShellLink.WindowStyle = 1
'oShellLink.Hotkey = ""
'oShellLink.IconLocation = ""
oShellLink.Description = sFileOldName & " shortcutted by " & WScript.ScriptName
oShellLink.WorkingDirectory = sFldrSource
' Save a shortcut to disk
oShellLink.Save
set oShellLink = Nothing
Next
Wscript.Echo colFilesS.Count, vbNewLine & sMsg
''''
Private Function FileNName( ByVal FileName)
'
'input argument: old file name
'returns: new file name
'
Dim sFileExt: sFileExt = objFSO.GetExtensionName( FileName)
Dim sFileBas: sFileBas = objFSO.GetBaseName( FileName)
Dim nCharPos: nCharPos = InStr( 1, sFileBas, CharToSplit, vbTextCompare)
If nCharPos > 0 And nCharPos < Len( sFileBas) Then
Dim sSpace: sSpace = Space( 1)
If InStr( 1, sFileBas, CharToSplit & sSpace, vbTextCompare) > 0 Then
Else
sSpace = ""
End If
FileNName = Trim( Mid( sFileBas, nCharPos + intCharLen)) _
& sSpace & Trim( Left( sFileBas, nCharPos)) & "." & sFileExt
Else
' returns not-changed old name, if it does not contain splitting character,
' or if splitting character is last one in old name.
FileNName = FileName
End If
End Function 'FileNName'
' Const ForReading=1, ForWriting=2, ForAppending=8
' Const OpenAsDefault = -2 ' Opens the file using the system default
' Const OpenAsUnicode = -1 ' Opens the file as Unicode
' Const OpenAs__ASCII = 0 ' Opens the file as ASCII
' Const RabbitEars = """"
HTH - Josef
Powered by vBulletin™ Version 4.1.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.