Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need a little program, please help clever programmers

Status
Not open for further replies.

SteveAudus

Technical User
Oct 4, 2001
409
GB
Could any of your clever VB people write a little program that would help out myself and my technicians.

We use 2 cmd line codes over and over again, on our NT workstations when we haven't got access to our 2K server,
and I was wondering if it possible to write some VB to replace them with a little GUI program.

I am no programmer myself, and I really need some help.

The 2 lines are
net user "user name" /domain
to check user details
and
net user "user name" newpassword /domain
to change a user's password.

maybe there is a program out there that does it already.

Thank you for any help,

Steve Audus
Chaucer School
Sheffield, UK
 
Hi,
Culd you be a little more elaborate? Hope it helps. Let me know what happens.
With regards,
PGK
 
You mean like hitting a key combination and that triggers an Exe which in turn copies certain text to the clipboard (then you can use Ctrl-V to paste the text), or copies the text to the active window? [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
I'm pretty sure SteveAudus just wants a form with two command buttons that call shells to the command lines he listed.
VCA.gif
 
Yes, this is probably so....I read too fast and not close enough. [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
Won't a .bat file do the job? Just put the 2 commands you type in into a text file with a .bat extension, then run this from a command prompt.
 
If guys think a cmd script would do it, thats cool.
But how do I write a script that asks for variables?

If I run the script I'd like it to ask for a user name
then ask if I'd like to change their password, if yes
then I'd type the password and enter and done.

That would be get, but I don't know where to start.

Alt255 meationed command buttons could I write something through Access?

Thanks for your help and suggestions

Steve Audus
Chaucer School
 
Why not use VBScript? It would be a happy medium between a full GUI, and a batch file.

Create the file ntstuff.vbs on your desktop, and place the following inside of it:

Code:
Dim objWScript, objExec
Dim myUserName
Dim strLaunchCmd

Set objWScript = CreateObject("WScript.Shell")

myUserName = InputBox("Please enter the user name")
strLaunchCmd = "net user """ & myUserName & """ /domain"

Set objExec = objWScript.Exec(strLaunchCmd)
WScript.Sleep 1000   'wait 1 second

It may be possible for you to see how to modify the script for your other question (changing the password). If this helps you, let me know, and I'll help you through the other one.

I await your reply, -iNSTA
aim: instar4per
email: instar4per @ hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top