Jump to content

Recommended Posts

Posted (edited)

Hi, I'm not up on my VBS scripting and wondered if anyone could help. I have inherited the below script for applying bginfo to different user groups, what I'd like to do is try and get it to apply the bginfo.bgi from a local folder rather that the current folder it resides on in the sysvol share. I guess it's the LaunchDir that really needs changing from WSHShell.CurrentDirectory to a local path somehow. Any help much appreciated :)

 

bginfo.vbs

Edited by Manny-Tech
  • 2 months later...
Posted (edited)

Ok,

 

DISCLAIMER - I am self taught VBS, bear with me ;-)

 

Firstly change the line

 

LaunchDir = WSHShell.CurrentDirectory

 

to

 

LaunchDir = "C:\Path\to\Tri-BGInfo-Students.bgi" - Basically your bgi file path C:\something\something\bgifile.bgi

 

then change

 

WSHShell.Run "%windir%\System32\bginfo.exe " & LaunchDir & "\Tri-BGInfo-Students.bgi" & " /timer:0 /nolicprompt /silent"

 

to

 

WSHShell.Run "%windir%\System32\bginfo.exe " & LaunchDir & " /timer:0 /nolicprompt /silent"

 

I am presuming this runs at logon, if so, make sure the BGI file path is accessible for the logged in user and not in a folder which they dont have access to.

 

You could do a bit of housekeeping and change your variable name from "LaunchDir" to "bgiFilePath" at the DIM line at the top and anywhere else LaunchDir is referenced, but this isnt essential to functionality, just makes it easier to read and make sense of a year from now when you have forgotten why you re wrote this :-).

 

Give that a try and let me know. If you want to do a screenshare on your copy of the file, PM me and we can do something over Skype.

 

Mike

 

 

Edits: Having lived in the UK since birth has not helped with me being too good at English and things

Edited by mbedford

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...