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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run vbscript on submit from a web page

Status
Not open for further replies.

Niavlys

IS-IT--Management
Jun 3, 2002
197
CA
Hi all,
I created a script that creates user account in Active Directory, creates share folder, set security, etc...
My scripts needs 5 arguments First name, last name, group, password, user type.

I tried an asp page that prompts the user for those informations and on submit button, calls the script. It looks like it should work but it doesn't.

Can someone help me please!
here is my asp page.

Code:
<%@ Language=VBScript %>
<html>

<head>
<%
  Fname = request.querystring(&quot;Fname&quot;) 
  Lname = request.querystring(&quot;Lname&quot;)
  Level = request.querystring(&quot;Level&quot;)
  Password = request.querystring(&quot;password&quot;)
  UserType = request.querystring(&quot;UserType&quot;)

  dim wsh, return
 
  if Fname <> &quot;&quot; Then
    set wsh = Server.CreateObject(&quot;WScript.Shell&quot;)
        return = wsh.run(&quot;CreateUser.vbs&quot; & &quot; &quot; & Fname & &quot; &quot; & Lname & &quot; &quot; & Level & &quot; &quot; & Password & &quot; &quot; & UserType,3,TRUE)
    Response.Write &quot;In IF   &quot; & Fname & &quot;return =   &quot; & return 
  End if 
  
 
%>
</head>
<body>
<form name=form1 method=&quot;get&quot;>
  	<h3>Select user type</h3>
	<p>Student: 
	<input type=&quot;radio&quot; checked name=&quot;UserType&quot; value=&quot;Students&quot;>
	<br>
	Teacher: 
	<input type=&quot;radio&quot; name=&quot;UserType&quot; value=&quot;Teachers&quot;>
	</p>
	<br>
	<h3>Enter user informations</h3>
	First Name :
	<input type=&quot;text&quot; name=&quot;Fname&quot;>
	<br>
	Last Name :
	<input type=&quot;text&quot; name=&quot;Lname&quot;>
  	<br>
	Group :
	<input type=&quot;text&quot; name=&quot;Level&quot;>
	<br>
	Password :
	<input type=&quot;password&quot; name=&quot;Password&quot;>
	<br>
	<br>
	<input type=&quot;submit&quot; value=&quot;Create User&quot;>
</form>
</body>
</html>[\code]

Thanks!
 
Can you give me a little more information about what is going on. Error's, what happens compared to what should happen, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top