Jump to content

oscar_nysushi

Member
  • Posts

    2
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United Kingdom

About oscar_nysushi

oscar_nysushi's Achievements

0

Reputation

  1. gunsmokingman. Thank for your reply, I can't see how a web page can control drive mapping? Yzowl. Thank for your reply, but i just need to hide the password, so it's looks like I need to go down the VBS route. I am not that bother about error checking the batch file, if they type something wrong, the script fails and they don't get connected. I have tried the code in a batch file, but I got this error. Any further suggestions? Thank you for your help. Steve E:\>{\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\froman\fcharset0 Time s New Roman;}{\f1\fswiss\fcharset0 Arial;}} The system cannot find the path specified. E:\>{\*\generator Msftedit 5.41.21.2508;}\viewkind4\uc1\pard\sb100\sa100\f0\fs24 @Echo off\line (Echo/wsh.echo "You entered: ", _\line Echo/ join(passwordbox(" Enter UID and password", "Testing"), ", ")\line Echo/\line Echo/' A function to present a Password dialog in a VBS (WSF) script\line Echo/' Requires WScript ver sion 5.1+\line Echo/' Tom Lavedas <tlave...@hotmail.com>\line Echo/Function Pass wordBox(sPrompt, sDefault)\line Echo/ set oIE = CreateObject("InternetExplorer.A pplication")\line Echo/ With oIE\line Echo/ .ToolBar = False\line Echo/ .Registe rAsDropTarget = False : .Navigate("about:blank")\line Echo/ While .Busy : WScrip t.Sleep 100 : Wend\line Echo/ With .document\line Echo/ With .ParentWindow\line Echo/ if Instr(.navigator.appVersion, "MSIE 6") = 0 Then\line Echo/ oIE.FullScre en = True\line Echo/ .resizeto 400,180\line Echo/ .moveto .screen.width/2-200, . screen.height/2-90\line Echo/ else\line Echo/ .resizeto 400,230\line Echo/ .move to .screen.width/2-200, .screen.height/2-115\line Echo/ End if\line Echo/ End Wi th\line Echo/ .Write("<html><head><" & "script>bboxwait=true;</" & "script>" _\l ine Echo/ & "<title>Password _____________________________ </title>" _\line Echo / & "</head><body bgColor=Silver scroll=no language=vbs" _\line Echo/ & " onkeyp ress=""if window.event.keycode=13 Then" _\line Echo/ & " bboxwait=false""><cente r><b> " & sPrompt & "<b> <p>" _\line Echo/ & "<table><tr><td> <b>User:</b></td>< td>" _\line Echo/ & "<input type=text id=user value='" & sDefault & "'>" _\line Echo/ & "</td><tr><td> <b>Password:</b></td><td>" _\line Echo/ & "<input type=pa ssword id=pass></td></tr></table><br>" _\line Echo/ & "<button onclick=""bboxwai t=false;""> Submit </button>" _\line Echo/ & "</center></body></html>")\line Ech o/ .ParentWindow.document.body.style.borderStyle = "outset"\line Echo/ .ParentWi ndow.document.body.style.borderWidth = "3px"\line Echo/ .all.user.focus\line Ech o/ On Error Resume Next\line Echo/ Do While .parentWindow.bBoxWait\line Echo/ oI E.Visible = True\line Echo/ if Err Then Exit Do\line Echo/ WScript.Sleep 100\lin e Echo/ Loop\line Echo/ oIE.Visible = False\line Echo/ if Err Then\line Echo/ Pa sswordBox = Array("CANCELLED")\line Echo/ Else\line Echo/ PasswordBox = Split(.a ll.user.value & "|" _\line Echo/ & .all.pass.value, "|")\line Echo/ End if\line Echo/ On Error Goto 0\line Echo/ End With ' document\line Echo/ End With ' IE\li ne Echo/End Function)\line Cscript //NoLogo c:\Windows\Temp\\_$.vbs\line Del c:\ Windows\Temp\\_$.vbs\line Pause\par 1>c:\Windows\Temp\\_$.vbs The system cannot find the path specified. E:\>\pard\f1\fs20\par The system cannot find the path specified. E:\>} '}' is not recognized as an internal or external command, operable program or batch file.
  2. I am sure this will be very easy for you clever scripting guys out there, here's a couple of questions. I have wrote this little script for some wireless laptops that we are not going to join our domain, but we'd like our students to access to thier home drives, and shared resources. =============================== echo off net use z: /delete net use t: /delete echo Please type your Year Group below and press enter (7,8,9,10 or 11) set /p Group= if "%Group%" == "7" set intake=2008 if "%Group%" == "8" set intake=2007 if "%Group%" == "9" set intake=2006 if "%Group%" == "10" set intake=2005 if "%Group%" == "11" set intake=2004 echo Please Type your Username (example astudent120589) set /p usern= echo Now please Type your Password set /p password= net use Z: "\\Server\User Storage\Pupils\%intake%\%usern%" /User:mydomain\%usern% %password% /PERSISTENT:NO net use T: "\\Server\student$" /User:mydomain\%usern% %password% /PERSISTENT:NO =============================== 1. It works but i'd prefer to hide the password as they type it? is it possible? 2. Also is it possible to add a line that to set the path of MY documents to Z: drive, so applications trying to save will pick z: as it's default location. Any help or suggestions on how to improve this script would be great. Thank you. Steve, Chaucer BEC, Sheffield UK www.chaucer.sheffield.sch.uk
×
×
  • Create New...