How can I create log on script with vbs as a beginner?

Asked By 10 points N/A Posted on -
qa-featured

Hi,

I need to create a log on script with vbs. But I don't know how to do it. As a beginner, how can I start? Please, tell me everything as easily as possible as I addressed myself as a beginner in the field.

Thanks

SHARE
Best Answer by Harpe byers
Answered By 0 points N/A #146250

How can I create log on script with vbs as a beginner?

qa-featured

To inscribe your own logon scripts into VBScript you need to download it from tool from SAPIEN.
It allows you to put up practice VBS-based logon scripts without requiring you to contain any familiarity of the internal workings of VBS.
You can get idea from the below link:
http://www.petri.co.il/forums/showthread.php?t=9607

Best Answer
Best Answer
Answered By 0 points N/A #146251

How can I create log on script with vbs as a beginner?

qa-featured








Dear Friend,
Logon Scripts in an operating system allows you to set certain tasks every time user log in. 
The VB commands are programming through which operating system understands these tasks. 
The commands are written in text editor e.g. Notepad. 
The tasks could be setting up a printer, updating software or updating virus signatures. 
To create such logon scripts here is one such example for you: 
 
1. Go to Start/Allprograms/Accessories, 
2. Open Notepad by double click, 
3. Copy and paste these commands: 
 
Const INDIA_GROUP     = "cn=india"
Const ENGLAND_GROUP   = "cn=england"
Const KENYA_GROUP = "cn=kenya"
 
Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "h:",
"\FileServerUsers" & wshNetwork.UserName
 
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" &
ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))
 
If InStr(strGroups, INDIA_GROUP) Then
 
    wshNetwork.MapNetworkDrive "g:",
    "\FileServerIndia"
    wshNetwork.AddWindowsPrinterConnection
    "\PrintServerEngLaser"
    wshNetwork.AddWindowsPrinterConnection
    "\PrintServerPlotter"
    wshNetWork.SetDefaultPrinter
    "\PrintServerEngLaser"
 
ElseIf InStr(strGroups, ENGLAND_GROUP) Then
 
    wshNetwork.MapNetworkDrive "g:",
    "\FileServerEngland"
    wshNetwork.AddWindowsPrinterConnection
    "\PrintServerFinLaser"
    wshNetWork.SetDefaultPrinter
    "\PrintServerFinLaser"
 
ElseIf InStr(strGroups, KENYA_GROUP) Then
 
    wshNetwork.MapNetworkDrive "g:",
    "\FileServerKenya"
    wshNetwork.AddWindowsPrinterConnection
    "\PrintServerHrLaser"
    wshNetWork.SetDefaultPrinter
    "\PrintServerHrLaser"
 
End If 
 
4. Open File menu from the extreme left on Notepad window, 
5. Click “Save As”. 
6. A separate window will open and first in "Save As" type, select “All files” from the drop down menu, 
7. Type a File Name with extension .vbs file, 
8. Now select the directory wherein domain controller’s Netlogon folder is shared from the extreme left side of Notepad to save this file. 
9. Click Save. 
I am sure you can do it. Go on!

Login/Register to Answer

Related Questions