Code: Select all
D:\_Downloads\2007\09\22\
Ich möchte nämlich gerne sofort in das Aktuellste Download Verzeichnis springen!
mfg liljawa
Moderators: Hacker, Stefan2, white
Code: Select all
D:\_Downloads\2007\09\22\
Code: Select all
sPath := "D:\_Downloads" ; Anpassen, oder als parameter übernehmen
loop
{
sTempDir := "0"
loop %sPath%\*, 2
{
if (A_LoopFileName > sTempDir)
sTempDir := A_LoopFileName
}
sPath .= "\" sTempDir
if not InStr(FileExist( sPath "\*" ), "D")
Break
}
sPath := SubStr( sPath, 1, StrLen(sPath)-1 )
Run "%COMMANDER_PATH%\Totalcmd.exe" /O /S "%sPath%"
Code: Select all
Option Explicit
Dim DownloadDir As String
Dim TotalCMDexe As String
Dim dYear As String
Dim dMonth As String
Dim dDay As String
Public Function SplitActDate()
Dim dTemp As String
dTemp = Date
dDay = Left(dTemp, 2)
dMonth = Mid(Date, 4, 2)
dYear = Right(dTemp, 4)
End Function
Public Function JumpToDownload()
If Dir(DownloadDir & "\" & dYear, vbDirectory) = dYear Then
CheckMonth:
If Dir(DownloadDir & "\" & dYear & "\" & dMonth, vbDirectory) = dMonth Then
CheckDay:
If Dir(DownloadDir & "\" & dYear & "\" & dMonth & "\" & dDay, vbDirectory) = dDay Then
Call ExecDownloadDir(DownloadDir & "\" & dYear & "\" & dMonth & "\" & dDay)
Else
Do While Val(dDay) > 1
dDay = Val(dDay) - 1
If Dir(DownloadDir & "\" & dYear & "\" & dMonth & "\" & dDay, vbDirectory) = dDay Then
Call ExecDownloadDir(DownloadDir & "\" & dYear & "\" & dMonth & "\" & dDay)
dDay = 1
End If
DoEvents
Loop
End If
Else
Do While Val(dMonth) > 1
dMonth = Val(dMonth) - 1
If Dir(DownloadDir & "\" & dYear & "\" & dMonth, vbDirectory) = dMonth Then
dDay = 31
GoTo CheckDay
End If
DoEvents
Loop
End If
Else
Do While Val(dYear) > 1
dYear = Val(dYear) - 1
If Dir(DownloadDir & "\" & dYear, vbDirectory) = dYear Then
dDay = 12
GoTo CheckMonth
End If
DoEvents
Loop
End If
End Function
Public Function ExecDownloadDir(TheDir As String)
Call Shell(TotalCMDexe & " /O /S " & TheDir)
End Function
Sub Main()
TotalCMDexe = "D:\Programme\Total Commander\totalcmd.exe"
DownloadDir = "D:\_Downloads\TimeLine"
Call SplitActDate
Call JumpToDownload
End Sub