Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $s = "C:\Code_AutoIt\Bla\Blub\Blib\Blob\something.exe"
- ConsoleWrite(_GetUpwardPath($s, 1) & ' @error: ' & @error & @CRLF)
- ConsoleWrite(_GetUpwardPath($s, 2) & ' @error: ' & @error & @CRLF)
- ConsoleWrite(_GetUpwardPath($s, 3) & ' @error: ' & @error & @CRLF)
- ConsoleWrite(_GetUpwardPath($s, 4) & ' @error: ' & @error & @CRLF)
- ConsoleWrite(_GetUpwardPath($s, 5) & ' @error: ' & @error & @CRLF)
- ConsoleWrite(_GetUpwardPath($s, 6) & ' @error: ' & @error & @CRLF)
- Func _GetUpwardPath($_sFullPath, $_iCountUp)
- Local $aFull = StringSplit($_sFullPath, '\')
- If $_iCountUp > ($aFull[0] -2) Then Return SetError(1,0,'') ; letzter Teil ist Datei selbst -> entfällt, Teil davor ist der aktuelle Ordner -> entfällt auch
- Local $sPathUpFolder = ''
- For $i = 1 To $aFull[0] -($_iCountUp +1)
- $sPathUpFolder &= $aFull[$i] & '\'
- Next
- Return $sPathUpFolder
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement