Advertisement
alexdevillx

DOS short path generator

Jun 16th, 2011
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Этот скрипт позволяет получить короткий путь к файлу.
  2. '(C)Alex.Devil.LX 2011
  3. Set FSO = CreateObject ("Scripting.FileSystemObject")
  4. 'Создаем объект FileSystemObject
  5. Set Dialog = CreateObject("UserAccounts.CommonDialog")
  6. 'Создаем диалог "Открыть файл"
  7. Dialog.Filter = "Все файлы (*.*) | *.*"
  8. Dialog.FilterIndex = 0
  9. Dialog.InitialDir = "C:\Documents and Settings\%Username%\"
  10. IntResult = Dialog.ShowOpen
  11. 'Настраиваем диалог
  12. Set file1 = FSO.GetFile (Dialog.FileName)
  13. ShPath = file1.ShortPath
  14. MsgBox "Короткий путь к файлу: " & ShPath , vbQuestion, "Короткий путь к файлу:"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement