NASLite Network Attached Storage

www.serverelements.com
Task-specific simplicity with low hardware requirements.
It is currently Sat May 11, 2024 2:21 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Telnet shutdown command
PostPosted: Sun Jun 24, 2007 10:17 am 
Offline

Joined: Sat Jun 02, 2007 2:45 am
Posts: 485
Location: France
Hi,

I have a very old MoBo and ACPI can not be activated. Thus, I cannot turn off the NL box with the power switch. :(

Actually, I have to Run Telnet from a distant computer, login/password select option 8 to turn off the NL box, wait for the beeps and turn off the power to the computer. :roll:

Is there a way to turn off NL with a shortcut and/or small program ?

TIA


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 24, 2007 10:38 am 
Offline

Joined: Fri Feb 02, 2007 5:04 pm
Posts: 109
Location: Belgium
Easy
I think it was georg who wrote the script

create a new wordpad-file and copy / paste the following


--------------------------------------------------------------------
'
' NAS_SHUT.VBS
'
' A script for Windows PC to remotely shutdown NASLite+ via the
' telnet login. Works with NASLite+ USB v1.5 under Windows XP/SP2
' both HomeEdition and Pro. Should work with other versions, even
' NASLite Free.
'
' Make sure to substitute the proper responses in Section A and
' the correct sequence in Section E and F.
'
' Originally 17March2006 by georg for the ServerElements Forum users.
'
' --------------------------------------------------------------------

' --------------------------------------------------------------------
' SECTION A: Some parameters ... for login and the NASLite+ Menu.
' --------------------------------------------------------------------

ServerName = "***.***.***.***" ' Use IP or name here (in quotes).

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 = 2000 ' 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


' --------------------------------------------------------------------
' SECTION E: NASLite+ Menu do a SHUTDOWN (or an XIT during testing)
' --------------------------------------------------------------------
WScript.Sleep DELAY
WshShell.SendKeys XIT + vbLf ' Change XIT to desired option.

' --------------------------------------------------------------------
' SECTION F: Confirm the selection.
' --------------------------------------------------------------------
WScript.Sleep DELAY
WshShell.SendKeys YES + vbLf


' OPTIONAL: (remove the comment tick mark to activate)
' MsgBox "NASLite+ Shutdown Started"

WScript.Quit



save as .vbs file and you're done
make sure you enter the correct ip-adress
and change XIT into SHUT after testing

good luck


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 24, 2007 11:47 am 
Offline

Joined: Sat Jun 02, 2007 2:45 am
Posts: 485
Location: France
Thanks a lot :)

I had searched the site but didn't find it, wrote my message and then changed my search words and found the script. It works.

Regards


Last edited by robrub on Mon Jun 25, 2007 2:47 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 25, 2007 11:13 am 
Offline

Joined: Sat Nov 19, 2005 6:39 pm
Posts: 633
Location: California
:D Georg


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 28, 2007 9:38 am 
Offline

Joined: Sat Jun 02, 2007 2:45 am
Posts: 485
Location: France
Hi Georg,

Thanks again for your script. :D

There is a small glitch though: the login "admin" should be sent in lowercase. If the keyboard is in uppercase, the login is sent in uppercase and the login doesn't work. I suppose this is valid for the password also.

Can this problem be solved in anyway? Am I the only one to have this glitch?

Best regards


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 28, 2007 10:10 am 
Offline

Joined: Sat Nov 19, 2005 6:39 pm
Posts: 633
Location: California
Robby:
Interesting ... did not test that. I'll have some time to check it out late today. Kind of odd though that the keystrokes being sent from inside the script are affected by caps-lock, but it could be that the command shell reads the state of the keyboard separately, even in batch mode. I'll look into it.
:) Georg


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 28, 2007 9:23 pm 
Offline

Joined: Sat Nov 19, 2005 6:39 pm
Posts: 633
Location: California
Robby:

I am not able to duplicate the problem.

1] Did you copy/paste the script as shown in this thread ? Or did you download SysRC_110A.zip from Eden's site ? Did you edit anything in the ZIP package ?
2] What version of Windows are you using ?
3] When you go into a command shell, and type "set" is there any environmental variable that has to do with Caps-Lock ?

I'll try to help debug your issue, but absent of being able to duplicate the issue, I need a lot more info.

:) Georg


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 30, 2007 10:48 am 
Offline

Joined: Sat Jun 02, 2007 2:45 am
Posts: 485
Location: France
Hi Georg,

Thanks in advance for your time :)

The spript I'm using is just for the login (I'm lazy) :oops: Comments, address IP and password cut off for the cut & paste.

' Originally 17March2006 by georg for the ServerElements Forum users.
' --------------------------------------------------------------------
' SECTION A: Some parameters ... for login and the NASLite+ Menu.
' --------------------------------------------------------------------

ServerName = "192.168.*.**" ' Use IP or name here (in quotes).

Username = "admin" ' Current Username
Passwd = "******" ' 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 = 1000 ' 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

WScript.Quit

And the SET command gives:

ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\WINXP\Application Data
CLASSPATH=.;C:\Program Files\Java\jre1.6.0_01\lib\ext\QTJava.zip
CommonProgramFiles=C:\Program Files\Fichiers communs
COMPUTERNAME=FUJITSU
ComSpec=C:\WINDOWS\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\WINXP
LOGONSERVER=\\FUJITSU
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;;;;;C:\Program Files\Fichiers communs\GTK\2.0\bin;C:\Program Files\QuickTime\QTSystem\;;C:\Program Files\Fichiers communs\Ahead\Lib\;C:\Program Files\Fichiers communs\Ahead\Lib\;C:\Program Files\Fichiers communs\Ahead\Lib\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 13 Stepping 6, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0d06
ProgramFiles=C:\Program Files
PROMPT=$P$G
QTJAVA=C:\Program Files\Java\jre1.6.0_01\lib\ext\QTJava.zip
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\WINXP\LOCALS~1\Temp
TMP=C:\DOCUME~1\WINXP\LOCALS~1\Temp
USERDOMAIN=FUJITSU
USERNAME=WINXP
USERPROFILE=C:\Documents and Settings\WINXP
windir=C:\WINDOWS

I can't see anything about caps lock :(

As for for the OS: Win XP Pro SP 2 French on a Fujitsu Siemens Laptop.

.../... Hip hip hip hourray, I found how things break down :lol:

There is a setting in XP which tells the machine how to turn off "caps lock". You can either hit "caps lock" key to turn it on and off (XP default setting) or set it so that "caps lock" key puts ON caps lock and "shift" key puts OFF caps lock (Win 98 setting).

If you leave the setting in "Caps lock does all the work" (XP default) setting the keyboard caps lock on/off position does NOT interfere with your script. If you seleck the option "shift" key turns off caps lock (as I have) then if the keyboard is in caps lock ON, your script sends the login in caps lock.

If you want to test, the setting is deep lost in XP parameters. Open Configuration panel > regional options and liguistics > language > detail > key parameters > you have the 2 options. The menu names may not be the same as I have translated them from French...

Tell me if you found them.

Regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group