+ Post New Thread
Results 1 to 2 of 2
Coding Thread, VBScript Logon Script not executing another file in Coding and Web Development; Hi all, I have the following script: Code: Set objShell = CreateObject("WScript.Shell") Set objNetwork = CreateObject("WScript.Network") If StrComp(Mid(objNetwork.ComputerName, 1, 4), ...
  1. #1

    Join Date
    Jan 2009
    Posts
    9
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    VBScript Logon Script not executing another file

    Hi all,

    I have the following script:

    Code:
    Set objShell = CreateObject("WScript.Shell")
    Set objNetwork = CreateObject("WScript.Network")
    If StrComp(Mid(objNetwork.ComputerName, 1, 4), "I1ZC") = 0 Then
    	objShell.run """C:\Program Files\YouthWire\YWPlatform.exe"""
    End If
    Set objNetwork = Nothing
    Set objShell = Nothing
    This is assigned to a few OUs. The script is definately executing (as evidenced by a couple of MsgBox calls dabbled throughout the program) and the If statement is definately returning TRUE. The program (YWPlatform.exe) does not execute on logon. However, if I create a shortcut to the script (which resides on SysVol) and execute it under one of our student user accounts (one under the OU that is executing the VBS file), the program runs absolutely fine.

    One thing I have noticed is that I get a File Security Warning dialog box asking me if I want to Open or Cancel running the VBS file - however this does not pop up when run on logon. Any advice on how to get the program to execute on logon would be most appreciated!

  2. #2

    Join Date
    Jan 2009
    Posts
    9
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by jinnantonnix View Post
    Have you enabled the 'run with elevated privileges' switch for login scripts on your GPO?
    Whereabouts would this switch be? Can't see anything obvious...

SHARE:
+ Post New Thread

Similar Threads

  1. VBScript, wildcards or file extensions
    By Bobo in forum Windows
    Replies: 4
    Last Post: 25th August 2011, 04:58 PM
  2. Replies: 9
    Last Post: 8th January 2009, 11:27 AM
  3. executing a random command in a batch file
    By Halfmad in forum Scripts
    Replies: 12
    Last Post: 6th November 2007, 09:25 PM
  4. Logon script & Printer script question.
    By Galway in forum Windows
    Replies: 3
    Last Post: 29th August 2007, 11:00 AM
  5. Replies: 4
    Last Post: 23rd March 2006, 06:27 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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