+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
Scripts Thread, Set background on a select group of computers using BGInfo in Coding and Web Development; Ta very much! Okay that means the error message disappears, but I'm back now with the same problem that I ...
  1. #16

    Join Date
    May 2006
    Posts
    1,315
    Thank Post
    101
    Thanked 25 Times in 18 Posts
    Rep Power
    25

    Re: Set background on a select group of computers using BGInfo

    Ta very much!

    Okay that means the error message disappears, but I'm back now with the same problem that I had with the batch script... it just doesn't work . It keeps setting it as the original background (i.e. the non it-suite one).

  2. #17

    Join Date
    May 2006
    Posts
    1,315
    Thank Post
    101
    Thanked 25 Times in 18 Posts
    Rep Power
    25

    Re: Set background on a select group of computers using BGInfo

    Kay, I have been playing about with the script a bit, but still can't get it working, even when I've cut half of the script out. I changed it so it should have just worked on my machine, but it still has the same result as above.

    (i.e. I changed the script to the following:

    set oShell=createobject("wscript.shell")
    set oNet=createobject("wscript.network")
    sComputer=ucase("oNet.computername")
    sCmd="%SYSTEMROOT%\bginfo.exe /i""\\SERVER\NETLOGON\BGINFO\curric.bgi"" /timer:0"
    if sComputer="IT-TECH-02" then
    sCmd="%SYSTEMROOT%\bginfo.exe /i""\\SERVER\NETLOGON\BGINFO\curric-web.bgi"" /timer:0"
    end if
    oShell.run sCmd
    The only effect this had on my machine (IT-TECH-02) was to set the background as curric.bgi .

    Also the following doesn't work on my machine:

    set oShell=createobject("wscript.shell")
    set oNet=createobject("wscript.network")
    sComputer=ucase("oNet.computername")
    sCmd="%SYSTEMROOT%\bginfo.exe /i""\\SERVER\NETLOGON\BGINFO\logoff.bgi"" /timer:0"
    if right(sComputer,2)="02" then
    sCmd="%SYSTEMROOT%\bginfo.exe /i""\\SERVER\NETLOGON\BGINFO\logoff-web.bgi"" /timer:0"
    end if
    oShell.run sCmd

    I'm guessing the value of sComputer isn't what we think it is?

  3. #18

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,154
    Thank Post
    114
    Thanked 527 Times in 450 Posts
    Blog Entries
    2
    Rep Power
    123

    Re: Set background on a select group of computers using BGInfo

    do you have the microsoft script debugger installed? If so, use it :-)

    It's at http://www.microsoft.com/downloads/d...displaylang=en (if that link doesn't work google for scd10en.exe)

    When it's installed, run your script by typing:

    <scriptname>.vbs //x

    This will launch it in the debugger and you can step through it to see what's going on. The toolbar buttons are not terribly intuitive but the tool tip on one of them is "step into" - click this to step through the program one line at a time. You can click on any line and press F9 to set a breakpoint; if you now press F5 the code will run to that point and then stop. When it's stopped you can open the command window (from the view menu) and check variable values - eg type ?computername to see the value scomputer has.

    You can also add lines like:

    wscript.echo sComputer

    to see the value it has (you probably want to change the default host to cscript to do this - cscript //h:cscript - otherwise you get popups for every "echo")

  4. #19

    Join Date
    May 2006
    Posts
    1,315
    Thank Post
    101
    Thanked 25 Times in 18 Posts
    Rep Power
    25

    Re: Set background on a select group of computers using BGInfo

    Okay, just an update on this, I got it working. It was my own fault...

    One of the lines was origally given as:

    sComputer=ucase(oNet.computername")
    As you can see, there is one speech mark there. I noticed it was wrong but instead of thinking that it shouldn't actually be there, I assumed it's partner had been missed out and added it. This obviously sets the exact value of sComputer to be "oNet.computername". I took the speech marks out and it works perfectly.

    Thanks once again Steve! It's a brilliant script.

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. BGinfo help!
    By mmoseley in forum Windows
    Replies: 34
    Last Post: 3rd October 2008, 06:29 PM
  2. Replies: 1
    Last Post: 7th September 2007, 02:16 PM
  3. BGInfo in logon script example?
    By ninjabeaver in forum How do you do....it?
    Replies: 16
    Last Post: 24th August 2007, 12:49 PM
  4. Replies: 22
    Last Post: 6th July 2007, 08:56 AM
  5. BGInfo on logon screen
    By Ric_ in forum Windows
    Replies: 17
    Last Post: 16th September 2006, 01:25 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
  •