![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| vista x64 ultimare | vb script on vista X64 not working the script below works perfectly on vista32 - but on X64 is reports it cannot find the file on line 21 it is for acceessing a remote computer i know nothing about vb - just found the script in a forum i have turned telnet on and that is working can anybody help thanks tony script below Quote: ServerName = "192.168.1.9" Username = "admin" ' Current Username Passwd = "nas" ' Current Password XIT = "E" ' Used to "EXIT" from NAS. (upper-case E) YES = "y" ' Used to confirm an option. (lower-case Y) SHUT = "8" ' Used to SHUTDOWN NAS. (number eight) DELAY = 250 ' Minimum 500ms recommended; 1000 works well. ' -------------------------------------------------------------------- ' SECTION B: Start a Shell ' -------------------------------------------------------------------- Set WshShell = WScript.CreateObject("WScript.Shell") ' -------------------------------------------------------------------- ' SECTION C: Start the TELNET ' -------------------------------------------------------------------- WshShell.Run "telnet " + ServerName ' -------------------------------------------------------------------- ' SECTION D: Login. ("Sleep" pauses are needed delays.) ' -------------------------------------------------------------------- WScript.Sleep DELAY WshShell.SendKeys Username + vbLf WScript.Sleep DELAY WshShell.SendKeys Passwd + vbLf |
My System Specs![]() |
| | #2 (permalink) |
| | Re: vb script on vista X64 not working "adacom" <guest@xxxxxx-email.com> wrote in message news:26acd3d36a924dccb1c10cb91f47494b@xxxxxx-gateway.com... Quote: > > the script below works perfectly on vista32 - but on X64 is reports it > cannot find the file on line 21 > > it is for acceessing a remote computer > > i know nothing about vb - just found the script in a forum > > i have turned telnet on and that is working > > can anybody help > > thanks > > tony > > > > script below > Quote: > > ServerName = "192.168.1.9" > > Username = "admin" ' Current Username > > Passwd = "nas" ' Current Password > > XIT = "E" ' Used to "EXIT" from NAS. (upper-case E) > > YES = "y" ' Used to confirm an option. (lower-case Y) > > SHUT = "8" ' Used to SHUTDOWN NAS. (number eight) > > DELAY = 250 ' Minimum 500ms recommended; 1000 works well. > > > > ' -------------------------------------------------------------------- > > ' SECTION B: Start a Shell > > ' -------------------------------------------------------------------- > > Set WshShell = WScript.CreateObject("WScript.Shell") > > > > ' -------------------------------------------------------------------- > > ' SECTION C: Start the TELNET > > ' -------------------------------------------------------------------- > > WshShell.Run "telnet " + ServerName > > ' -------------------------------------------------------------------- > > ' SECTION D: Login. ("Sleep" pauses are needed delays.) > > ' -------------------------------------------------------------------- > > WScript.Sleep DELAY > > WshShell.SendKeys Username + vbLf > > WScript.Sleep DELAY > > WshShell.SendKeys Passwd + vbLf > > -- > adacom point out which line is line 21. This would also eliminate any confusion arising from leading blank lines. |
My System Specs![]() |
| | #3 (permalink) |
| vista x64 ultimare | Re: vb script on vista X64 not working not understanding vb i have to guess which is line 21 - i am assuming blank lines are counted so this would seem to be the error line -or maybe they all are faulty and line 21 is the first faulty line Quote: WshShell.Run "telnet " + ServerName |
My System Specs![]() |
| | #4 (permalink) |
| | Re: vb script on vista X64 not working "adacom" <guest@xxxxxx-email.com> wrote in message news:9da40364818de2ef38e3706996edd426@xxxxxx-gateway.com... Quote: > > not understanding vb i have to guess which is line 21 - i am assuming > blank lines are counted so this would seem to be the error line -or > maybe they all are faulty and line 21 is the first faulty line > Quote: >> WshShell.Run "telnet " + ServerName > sorry i cannot be sure - that was the reason for my post > > > -- > adacom really sure, insert some labels like so: ServerName = "192.168.1.9" Quote: > Username = "admin" ' Current Username > Passwd = "nas" ' Current Password > XIT = "E" ' Used to "EXIT" from NAS. (upper-case E) > YES = "y" ' Used to confirm an option. (lower-case Y) > SHUT = "8" ' Used to SHUTDOWN NAS. (number eight) > DELAY = 250 ' Minimum 500ms recommended; 1000 works well. > > ' -------------------------------------------------------------------- > ' SECTION B: Start a Shell > ' -------------------------------------------------------------------- > Set WshShell = WScript.CreateObject("WScript.Shell") ' -------------------------------------------------------------------- ' SECTION C: Start the TELNET ' -------------------------------------------------------------------- wscript.echo "Label 2" WshShell.Run "telnet " + ServerName ' -------------------------------------------------------------------- ' SECTION D: Login. ("Sleep" pauses are needed delays.) ' -------------------------------------------------------------------- wscript.echo "Label 3" Quote: > WScript.Sleep DELAY > WshShell.SendKeys Username + vbLf > WScript.Sleep DELAY > WshShell.SendKeys Passwd + vbLf cscript.exe //nologo c:\MyScript.vbs |
My System Specs![]() |
| | #5 (permalink) |
| vista x64 ultimare | Re: vb script on vista X64 not working thanks done some checking and it is as i thought - line 21 in my original posted code is Quote: WshShell.Run "telnet " + ServerName |
My System Specs![]() |
| | #6 (permalink) |
| | Re: vb script on vista X64 not working "adacom" <guest@xxxxxx-email.com> wrote in message news:04f3bc9291f7aea763f221a8eee3e2e7@xxxxxx-gateway.com... Quote: > > thanks > > done some checking and it is as i thought - line 21 in my original > posted code is > Quote: >> >> WshShell.Run "telnet " + ServerName >> > > -- > adacom - Does "telnet.exe" exist? - Where does it reside? - Is its location included in the %path%? - What happens when you type "telnet" (without the quotes) at the Command Prompt? Also: - What are you actually trying to do with this script? - To concatenate strings in VB Scripts, use the & symbol, not the + symbol. - To make your script more robust, make it "telnet.exe" instead of just "telnet". - To avoid confusion, change "ServerName" to "ServerIP" throughout the program. - Since I don't have ready access to a 64-bit machine I cannot test your code. It might be safer to invoke the Run method like so: WshShell.Run "cmd.exe /c telnet.exe " + ServerName |
My System Specs![]() |
| | #7 (permalink) |
| vista x64 ultimare | Re: vb script on vista X64 not working "adacom" <guest@xxxxxx-email.com> wrote in message news:04f3bc9291f7aea763f221a8eee3e2e7@xxxxxx-gateway.com... Quote: > > thanks > > done some checking and it is as i thought - line 21 in my original > posted code is > Quote: >> >> WshShell.Run "telnet " + ServerName >> > > -- > adacom - Does "telnet.exe" exist? - Where does it reside? - Is its location included in the %path%? - What happens when you type "telnet" (without the quotes) at the Command Prompt? Also: - What are you actually trying to do with this script? - To concatenate strings in VB Scripts, use the & symbol, not the + symbol. - To make your script more robust, make it "telnet.exe" instead of just "telnet". - To avoid confusion, change "ServerName" to "ServerIP" throughout the program. - Since I don't have ready access to a 64-bit machine I cannot test your code. It might be safer to invoke the Run method like so: WshShell.Run "cmd.exe /c telnet.exe " + ServerName its not my script - it is for controlling the software that runs a nas server from windows it works perfectly in 32bit vista - but gives the errow when run on 64 bit vista will try some of your suggestions but it will be no more than trial and error as i have no knowledge of vb |
My System Specs![]() |
| | #8 (permalink) |
| vista x64 ultimare | Re: vb script on vista X64 not working thanks all for the input -as i said i know nothing about vbscripts so what i saw looked fine - but followed the advice from Pegasus and it now works would just seem X64 is more picky than other versions of windows so thanks again am well pleased tony |
My System Specs![]() |
| | #9 (permalink) |
| Windows Vista™ Ultimate | Re: vb script on vista X64 not working I just tried your Script on VistaX64 and it worked perfectly for me? Steven |
My System Specs![]() |
| | #10 (permalink) |
| vista x64 ultimare | Re: vb script on vista X64 not working thanks Steven - as it does for me now - i think it was always ok - just seemed to be where it was stored it was in a directory on drive d where it is/was on vista32 - on 32 it worked fine - but not on 64 - if i move it to the desktop it works beyond me and i am not taking it further - it works that will do |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Logon script - function array and select case not working | VB Script | |||
| Group membership script not working-help | VB Script | |||
| problem passing args to script 'There is no script engine for file extenstion' | VB Script | |||
| Static USB drive letters in XP (working script) | VB Script | |||
| why my script not working ? | PowerShell | |||