Solved

VBA login script

Posted on 2011-03-18
13
797 Views
Last Modified: 2012-05-11
I'm looking for a vba login script to authenticat a windows xp home to a windows server 2003.
I know that a batch file like bellow will do it. I just want to try a vba script.
---------------------------------
net use \\192.168.10.200\DataFile /user:myusername mypassword
---------------------------------

thank you
0
Comment
Question by:MnInShdw
  • 5
  • 4
  • 4
13 Comments
 
LVL 11

Expert Comment

by:Tasmant
ID: 35166766
You can try this:
Set oNet = CreateObject("WScript.Network")
oNet.MapNetworkDrive "H:", "\\192.168.10.200\DataFile", True, "MyUsername","MyPassword"

Open in new window

0
 
LVL 11

Expert Comment

by:Tasmant
ID: 35166771
you need to save this to a .vbs file
0
 
LVL 1

Author Comment

by:MnInShdw
ID: 35166913
I don't need to map any network drive.
Just authentication with the server. (if possible)

thank you
0
 
LVL 11

Expert Comment

by:Tasmant
ID: 35166955
it depends on what you want to do with your code.
not all functions provide a way to authenticate, and most of the time you will use your current credentials (ie the current username and password you entered at logon screen).
based on your current credentials, a negotiation for authentication will be done transparently between your computer and the server (Kerberos or NTLM) in AD domains.
so if you need more help to supply alternate credentials in your script, you need to post some part of your code in order to know what is your need and be able to see if any part of your code can be improved with what you need.
for the moment we cannot help you more.

you should add VB Script zone if you want more experts to see this topic.
0
 
LVL 1

Author Comment

by:MnInShdw
ID: 35167124
Here's the situation;

I've been asked to add a windows xp home to a network.
This network contains a windows server 2003 as the server and a lot of windows XPs as clients.
Active Directory (Domain) is not set up. The server is used just as a simple file server.
Each time this windows xp home accesses a shared folder on the server, a login dialog box is poped up which asks for a username and a password.
Because windows xp home hasn't "Remember Password" checkbox, the users of this PC has to input the password and the username to be able to access the shared folder.

I use a batch file that runs from startup to authenticate this machine with the server. In this way the login dialog box won't pop up.
this is the batch file that I use:
---------------------------------
net use \\192.168.10.200\DataFile /user:myusername mypassword
---------------------------------

I was just looking for a vba script to do the same task.
Each time the windows xp home reboots, this vba script will be run and atuthenticate it with the server.


I hope I'm clear enough.

Many Thanks.

0
 
LVL 11

Expert Comment

by:Tasmant
ID: 35167155
but you already do the job with your batch, what would you like to change?
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 11

Expert Comment

by:Tasmant
ID: 35167159
what do you believe the vba will do much more than a batch ?
0
 
LVL 1

Author Comment

by:MnInShdw
ID: 35167194
1- I learn a little bit about vba
2- it's just a test
3- a batch file will bring up cmd for a second, but running a vba script won't bring up(show) any ugly black screen.

 
0
 
LVL 21
ID: 35167973
You can hide the "ugly black screen"
0
 
LVL 21

Accepted Solution

by:
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 500 total points
ID: 35167987
Oops ... forgot the example:

here is a VBS scriptexampl:

RunHiiden.vbs
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False

Open in new window

0
 
LVL 21
ID: 35168011
IIRC,  set up the name user name and password on with the XP Home and the server. I think this will do automatic authentication.
0
 
LVL 1

Author Closing Comment

by:MnInShdw
ID: 35169949
I have no idea what this IIRC is.
Any kind of information about it is much appreciated.

Million thanks for your help.

By the way, as you suggested I added another question in VB section to find out if VB is able to [b]only[/b] do the authentication or not.

you may want to reply there too.
http://www.experts-exchange.com/Programming/Languages/Q_26897561.html

Once again thanks for your time and help.
0
 
LVL 21
ID: 35169976
FYI: IIRC = If I Remember Correctly
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

by Batuhan Cetin In this article I will be guiding through the process of removing a failed DC metadata from Active Directory (hereafter, AD) using the ntdsutil tool in a Windows Server 2003 environment. These steps are not necessary in a Win…
I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now