Xshell Forum

scripts error!help me!

Last post: Tuesday, July 14, 2015 7:37 AM by Support, 4 reply

 
Friday, October 4, 2013 11:02 AM - zergs

scripts error!help me!

 
i want get my scripts name,it can work on cmd but cann't work on xshell4,no "WScript" object!help me

my scritps:
Sub Main
Dim fso,f,sname,pwd
Set fso = CreateObject("Scripting.FileSystemObject")
f = fso.GetFile(WScript.scriptfullname).name
sname = Split(f,".")(0)
xsh.Dialog.MsgBox(sname)
'xsh.Screen.Send "ssh root@"+sname+".test.com"
'xsh.Screen.Send VbCr
'xsh.Screen.WaitForString "password: "
'xsh.Screen.Send "password"
'xsh.Screen.Send VbCr
End Sub

Program Ver. : Xshell 4
Saturday, October 5, 2013 6:29 AM - zergs

Re: scripts error!help me!

 
i'm sorry for my pool english
can get script name from vbs or other mothed?

the detailed information

1 vbs for cmd(cmd_run.bmp),good:
Sub Main
Dim fso,f,sname,pwd
Set fso = CreateObject("Scripting.FileSystemObject")
f = fso.GetFile(WScript.scriptfullname).name
sname = Split(f,".")(0)
MsgBox(sname)
'xsh.Screen.Send "ssh root@"+sname+".test.net"
'xsh.Screen.Send VbCr
'xsh.Screen.WaitForString "password: "
'xsh.Screen.Send "password"
'xsh.Screen.Send VbCr
End Sub
call Main

2 vbs for xshell(xshell_run.bmp),bad:
Sub Main
Dim fso,f,sname,pwd
Set fso = CreateObject("Scripting.FileSystemObject")
f = fso.GetFile(WScript.scriptfullname).name
sname = Split(f,".")(0)
xsh.Dialog.MsgBox(sname)
End Sub
Sunday, October 6, 2013 11:44 PM - Support

Re: scripts error!help me!

 
There seems to be problem with executing the "f = fso.GetFile(WScript.scriptfullname).name" and more specifically the WScript function.

It has been reported and our developers will review them.


---
Technical Support
Thursday, July 2, 2015 12:30 PM - Rahil

Re: scripts error!help me!

 
I have been seeing the same problem.
It seems that Xshell can't create file system object in VB.
Please fix this problem as it severely limits scripts capabilty by not allowing it to use any file.
Thanks.
Tuesday, July 14, 2015 7:37 AM - Support

Re: scripts error!help me!

 
We are looking into script problem right now. Meanwhile, can you attach your script for us to review?


---
Technical Support