scripts error!help me! [4]

scripts error!help me!

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

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


Re: scripts error!help me!

Saturday, October 5, 2013 6:29 AM - zergs

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


Re: scripts error!help me!

Sunday, October 6, 2013 11:44 PM - Support

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


Re: scripts error!help me!

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

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.


Re: scripts error!help me!

Tuesday, July 14, 2015 7:37 AM - Support

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


---
Technical Support


Previous views: 302