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: Script Request 
Author Message
Flasher



PostPosted: Mon Oct 25, 2010 21:33    Post subject: Reply with quote

Code:
'=====================================================
' Переход на сменные накопители и переключение между ними
' Авторcтво: по мотивам скрипта Batya
'=====================================================
Option Explicit
Dim FSO, WSH, D, Disk, TCPath, Drive
Set FSO = CreateObject("Scripting.FileSystemObject")
Set WSH = CreateObject("WScript.Shell")
Drive   = UCase(FSO.GetDriveName(WSH.CurrentDirectory))
For Each D In FSO.Drives
  If D<>"A:" And D.DriveType=1 And UCase(D.Path)<>Drive Then
      Disk = D.Path & "\"
     Exit For
  End If
  On Error GoTo 0
Next
  TCPath  = WSH.ExpandEnvironmentStrings("%Commander_Path%")_
 & "\totalcmd.exe"
WSH.Run """" & TCPath & """ /S /O /L=""" & Disk & """", 1, True
Set D   = Nothing
Set WSH = Nothing
Set FSO = Nothing
WScript.Quit 0
Плюс - быстрый доступ в флешкам, внешним хардам при заваленной панели дисков из виртуальных, сетевых и жёстких томов.
Минус - переключается только между двумя первыми см. накопителями. (тут, конечно, не помешает помощь Batya)
View user's profile Send private message


Powered by phpBB © 2001, 2005 phpBB Group