Results 1 to 4 of 4

Thread: shell not working :-/ [resolved]

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2004
    Location
    Birmingham, UK
    Posts
    23

    shell not working :-/ [resolved]

    hi, trying to get the names of the computers connected on the network:

    Code:
    Option Explicit
    
    Dim wShell
    Set wShell = WScript.CreateObject("WScript.Shell")
    
    wShell.Run "net view>c:\new\temp.txt", 2,true
    
    
    Set wShell = Nothing
    The file temp.txt does exist, but nothing is written to it


    Anyone know why?

    Thanks,

    Amleto


    edit:
    got this to work:

    Code:
    wShell.Run "cmd /c net view>c:\new\temp.txt", 2,true
    Last edited by Amleto; Apr 8th, 2004 at 06:21 AM.

  2. #2
    Frenzied Member Ideas Man's Avatar
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    1,718
    Why don't you just use Shell(...)?
    I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2004
    Location
    Birmingham, UK
    Posts
    23
    Because it doesn't work in vbs

  4. #4
    Frenzied Member Ideas Man's Avatar
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    1,718
    Sorry, didn't realise what language you were using.
    I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width