Manny-Tech Posted January 4, 2019 Posted January 4, 2019 (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 January 4, 2019 by Manny-Tech
mbedford Posted March 11, 2019 Posted March 11, 2019 Hi I can probably help you with this, is the file path going to be the same on every machine, every time? Mike
Manny-Tech Posted March 11, 2019 Author Posted March 11, 2019 Yes it would be. I'd forgotten all about this one!
mbedford Posted March 11, 2019 Posted March 11, 2019 (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 March 11, 2019 by mbedford
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now