Results 1 to 2 of 2

Thread: Will this work in VB

  1. #1
    Senior Member
    Join Date
    Jun 2004

    Will this work in VB

    Will this code work as a VBS logon script?

    Dim objNet

    Set objNet = CreateObject("Wscript.Network")

    objNet.MapNetworkDrive "F:", "\\servername\drive"

    Set wshObject = Wscript.CreateObject("Wscript.Shell")
    desktopFolder = wshObject.SpecialFolders("Desktop")
    set myShortcut = wshObject.CreateShortcut(desktopFolder & "\Notepad.lnk")
    myShortcut.TargetPath = "%windir%\Notepad.exe"

    end of script
    I will of course replace all the needed dir and paths.

    - MilitantEidolon
    Yeah thats right........I said It!

    Ultimately everyone will have their own opinion--this is mine.

  2. #2
    Custom User
    Join Date
    Oct 2001
    I don't know any vb, but most programming languages I've used are case sensitive. I noticed that you had a few things that were different cases like "Set" and "set" and "Wscript" and "WSCript" (although I'm not sure if they were just two different variables. If they are, you should change the names to something more obvious so that people can tell them apart easier.

    I could be wrong about all of that...could just be a vb thing, but thought I'd point it out anyway.


Posting Permissions

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