Total Commander Forum Index Total Commander
Форум поддержки пользователей Total Commander
Сайты: Все о Total Commander | Totalcmd.net | Ghisler.com | RU.TCKB
 
 RulesRules   SearchSearch   FAQFAQ   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Single Post  Topic: SynPlus 
Author Message
Batya



PostPosted: Mon Apr 07, 2008 10:06    Post subject: Reply with quote

Это мой скрипт.
[+] Добавил новый параметр CreateNewFile, изменяемый в теле скрипта.
[*] Небольшие исправления кода.
Code:
Dim CreateNewFile
'============ Изменяемые параметры =================
CreateNewFile = True 'Предварительное создание файла
'===================================================

Dim Editor, FilePath
Editor   = WScript.Arguments(0)
FilePath = WScript.Arguments(1)
CreateObject("WScript.Shell").Run """" & Editor & """ """ & NextName(FilePath) & """", 5, False

WScript.Quit()

Function NextName(pFilePath)
  Dim FSO, Path, Name, Ext, i, Ending
  Set FSO = CreateObject("Scripting.FileSystemObject")
  Path = FSO.GetParentFolderName(pFilePath) & "\"
  Name = FSO.GetBaseName(pFilePath)
  Ext  = FSO.GetExtensionName(pFilePath)
  Do While FSO.FileExists(Path & Name & Ending & "." & Ext)
    i = i + 1
    Ending = Right("0" & i, 2)
  Loop
  NextName = Path & Name & Ending & "." & Ext
  If CreateNewFile Then
    FSO.CreateTextFile(Path & Name & Ending & "." & Ext)
  End If
  Set FSO = Nothing
End Function

_________________
Нет, я не сплю. Я просто медленно моргаю.
View user's profile Send private message


Powered by phpBB © 2001, 2005 phpBB Group