Announcement

Collapse
No announcement yet.

Count FTP session in Windows Scripting Host

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Count FTP session in Windows Scripting Host

    I need to be able to make a WSH script on an FTP server wait before running until there are no active FTP sessions.
    I have tried the following but not with luck, does anyone have any ideas

    DO
    Wscript.Sleep 5000
    Dim strComputer, objWMIService,colFTPSessions
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & _
    strComputer& "\root\cimv2")
    Set colFTPSessions = objWMIService.ExecQuery _
    ("Select * from Win32_PerfFormattedData_FTPService(_TOTAL)_Current Connections")
    Loop until colFTPSessions.count = 0
Working...
X