| View previous topic :: View next topic |
| Author |
Message |
elfidge Just popping in
Joined: 13 Oct 2007 Posts: 3
|
| Posted: Sat Oct 13, 2007 1:06 pm Post subject: VB Login Scripts |
|
|
I'm looking to move my login script from a batch file to a VB script. After spending shed loads of time googling, I came up with the following, but it still doesn't appear to work. Any ideas??
Option Explicit
Dim objNetwork, objUser, CurrentUser
Dim strGroup
Dim wshShell
Dim ObjShell
' ** eMailSignature **
Set objShell = WScript.CreateObject("WScript.Shell")
ObjShell.run("\\srvdc01\netlogon\sign.exe" & "Provider=sqloledb;Data Source=SRVAPP03;Initial Catalog=eMailSignature;Integrated Security=SSPI")
Set ObjShell=Nothing |
|
| Back to top |
|
 |
Bjarne Mess Certified Professional


Joined: 01 May 2007 Posts: 735 Location: Copenhagen
|
| Posted: Sat Oct 13, 2007 5:36 pm Post subject: VB Login Scripts |
|
|
Have you tried this:
Set objShell = WScript.CreateObject("WScript.Shell")
ObjShell.run("\\srvdc01\netlogon\sign.exe Provider=sqloledb;Data Source=SRVAPP03;Initial Catalog=eMailSignature;Integrated Security=SSPI")
Set ObjShell=Nothing |
|
| Back to top |
|
 |
Jesper Frier Certified Professional


Joined: 09 Sep 2006 Posts: 1940 Location: Stoevring, Denmark
|
| Posted: Sun Oct 14, 2007 6:59 am Post subject: Include space after Sign.exe |
|
|
| elfidge wrote: | | "\\srvdc01\netlogon\sign.exe" & "Provider=sqloledb;Data Source=SRVAPP03;Initial Catalog=eMailSignature;Integrated Security=SSPI" |
becomes ...
| Quote: | | "\\srvdc01\netlogon\sign.exeProvider=sqloledb;Data Source=SRVAPP03;Initial Catalog=eMailSignature;Integrated Security=SSPI" |
So you need to add a space after Sign.exe like in reply from Bjarne. |
|
| Back to top |
|
 |
elfidge Just popping in
Joined: 13 Oct 2007 Posts: 3
|
| Posted: Mon Oct 15, 2007 8:10 am Post subject: VB Login Scripts |
|
|
Tried both this morning - both throw the same error I've been getting using this method:
Script: \\SRVDC01\NETLOGON\logon.vbs
Line: 16
Char: 1
Error: The system cannot find the file specified
Code: 80070002
Source: (null)
Script is as below:
Option Explicit
Dim objNetwork, objUser, CurrentUser
Dim strGroup
Dim wshShell
Dim ObjShell
' ** eMailSignature **
Set objShell = WScript.CreateObject("WScript.Shell")
ObjShell.run("\\srvdc01\netlogon\sign.exeProvider=sqloledb;Data Source=SRVAPP03;Initial Catalog=eMailSignature;Integrated Security=SSPI")
Set ObjShell=Nothing
Any further ideas? I can get sign.exe to run on it's own, I just can't get all the switches after it to function properly... |
|
| Back to top |
|
 |
Jesper Frier Certified Professional


Joined: 09 Sep 2006 Posts: 1940 Location: Stoevring, Denmark
|
| Posted: Tue Oct 16, 2007 6:49 am Post subject: Add space |
|
|
This is wrong - you need to add space after Sign.exe
| elfidge wrote: | | ObjShell.run("\\srvdc01\netlogon\sign.exeProvider=sqloledb;Data Source=SRVAPP03;Initial Catalog=eMailSignature;Integrated Security=SSPI") |
This is correct:
| Bjarne Mess wrote: | | ObjShell.run("\\srvdc01\netlogon\sign.exe Provider=sqloledb;Data Source=SRVAPP03;Initial Catalog=eMailSignature;Integrated Security=SSPI") |
|
|
| Back to top |
|
 |
elfidge Just popping in
Joined: 13 Oct 2007 Posts: 3
|
| Posted: Tue Oct 16, 2007 11:13 am Post subject: VB Login Scripts |
|
|
Thanks Jesper - appears to be working, good stuff.
:D |
|
| Back to top |
|
 |
Bjarne Mess Certified Professional


Joined: 01 May 2007 Posts: 735 Location: Copenhagen
|
| Posted: Wed Oct 17, 2007 12:25 pm Post subject: |
|
|
Great  |
|
| Back to top |
|
 |
kevinweiland Quite a regular
Joined: 08 Nov 2007 Posts: 15 Location: Spring, TX
|
| Posted: Mon Mar 10, 2008 7:29 pm Post subject: |
|
|
| Can you use a Microsoft access database with the VB script? |
|
| Back to top |
|
 |
Bjarne Mess Certified Professional


Joined: 01 May 2007 Posts: 735 Location: Copenhagen
|
| Posted: Mon Mar 10, 2008 7:46 pm Post subject: VB Login Scripts |
|
|
| Yes |
|
| Back to top |
|
 |
kevinweiland Quite a regular
Joined: 08 Nov 2007 Posts: 15 Location: Spring, TX
|
| Posted: Mon Mar 10, 2008 8:37 pm Post subject: |
|
|
| not a moment after i posted that i got it working...nifty! |
|
| Back to top |
|
 |
Bjarne Mess Certified Professional


Joined: 01 May 2007 Posts: 735 Location: Copenhagen
|
| Posted: Mon Mar 10, 2008 11:36 pm Post subject: Acces DB |
|
|
Well, that's the most important thing.
Cheers,
Bjarne |
|
| Back to top |
|
 |
|