Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving VBscript as WSH 1

Status
Not open for further replies.
Mar 1, 2004
204
GB
Hi,

I am a real newbie at this. I am trying to save a Basic VBscript file I have written as a test for an If statement and it says it cant because of the following error:-

"There is no script file specified"

I have tried to save this as a .wsh extension and am currently running windows XP. The code (Very basic) is as follows:-

Option Explicit
Dim MyVar
Dim MyInput
Dim Shell

Set Shell = WScript.CreateObject("WScript.Shell")


MyInput=InputBox("Enter a name","Name")
If MyInput="clive" then
MsgBox("Hello " & MyInput)
Else
MsgBox("Incorrect name " & MyInput & ". It should be clive")
End If

Can anyone explian why I get the error message when trying to run this script.

Thanks in advance
 
Save it with .vbs extension.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks. I did realise this basic error after posting this. Thankyou for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top