Solved

how do i run/execute files with a .vbs extention ?

Posted on 2001-06-25
20
351 Views
Last Modified: 2013-12-29
hi..
i have a file with a .vbs extention which is wrongly associated with ms media player. i wanted to know which program to associate with it to run the .vbs file.

thanks
vikky
0
Comment
Question by:vikky999
  • 7
  • 5
  • 2
  • +4
20 Comments
 
LVL 23

Expert Comment

by:slink9
ID: 6224250
It is vbscript and should be associated with visual basic.  Do you know the source of this file?  Do you know that it is not a virus?
If you want to associate it with visual basic you can open explorer, browse to that file, shift-right-click it, and select Open With.
0
 

Author Comment

by:vikky999
ID: 6224277
the file that i have isnt a virus. its a virus buster..well not exactly but still . infact i did try to open it in vb but i got a zillion errors...any other software that runs a .vbs file?
0
 
LVL 15

Expert Comment

by:lyonst
ID: 6224288
Hi,

The file type is Visual Basic Script file (I assume it is not a virus).

It can be opened with Visual Basic as follows...

Its simple all you need to do is change the file association.

You can do this in several ways ..

Select an file - hold down the shift key and right click on it.  Choose open with and select the

application you now wish to use to view the file.

1. In Explorer or My Computer, select a file with a .vbs extension.
2. From your menu, choose View, then Options, then File Types.
3. Select VBS file, then click the Edit button.
4. When the Edit File Type dialog box opens, click New.
5. In the Action box, type Open in XXXXX ( xxxxx - whatever application you want to use).
6. Click the Browse button, and select your new application. It will appear in the
  dialog box for  "Application used to perform action" and will probably
  be listed as:"C:\Program Files\VB6.exe"
7. Click o.k., then the close button.

Cheers,

T.
0
 
LVL 15

Expert Comment

by:lyonst
ID: 6224291
Also,

Just associate it with notepad and open it and see what it looks like.

T.
0
 
LVL 6

Expert Comment

by:kahlean
ID: 6224469
a vbs script contains visual basic script which can be executed by the program specific by the vbs file. The only way is that you have to know it better.
0
 
LVL 6

Expert Comment

by:kahlean
ID: 6224550
you can try to invoke this vbs file by activitaing manual using dos. You can identify any exe file that might use to trigger the vbs file, just type the <program name> <vbs file name> ..

Example


cscript newsletter.vbs

my assumption is base on my experinece of using vbs file in sending newsletter, wherby the csript program will activate this newsletter vbs file. Hope it could give you some hint here.

Regarsds
0
 
LVL 6

Expert Comment

by:kahlean
ID: 6224579
i have miss your previous comment. For vbs file you dont need and file association to it. Infact specific executable program will invoke specific vbs file regardsless of its association, so it hard to tell what program is needed to run the vbs file. You can remove the vbs file association and it will still runs fine.

Regards
0
 

Author Comment

by:vikky999
ID: 6224604
i have a 15kb vbs file that i just downloaded from the net...can somebody take a look at it and tell me what to do with it ?..wait..ill send a little bit
Option Explicit

Dim Message, Title, Text1
Dim fso, WSHSHell, exefile, htmlfile
Dim tStart, tElapsed
Dim timeout1, timeout2, timeout3
Dim state(255)
Dim key(255)
Message = "Enter the name of the executable to wrap in Godmessage IV"
Title = "6IT's Godmessage IV Creator v0.4"
Text1 = "Sorry, user input was canceled"
Set fso = CreateObject("Scripting.FileSystemObject")
Set WSHShell = CreateObject("WScript.Shell")
Const ForReading = 1
Const ForAppending = 8
exefile = InputBox(Message,Title,"onz.exe", 4000, 3000)
If exefile = "" Then
     WScript.Echo Text1
     WScript.Quit()
ElseIf exefile = "onz.exe" Then

     If fso.FileExists(exefile) Then
          GMCreate()
     Else
          WScript.Echo "File Doesn't Exist!"
          WScript.Quit()
     End If
Else
     If fso.FileExists(exefile) Then
          fso.CopyFile exefile, "onz.exe", True
          GMCreate()
     Else
          WScript.Echo "File Doesn't Exist!"
          WScript.Quit()
     End If
End If
WScript.Echo "Success! and Elapsed time=" & tElapsed & " seconds"
WScript.Quit()

Sub GMCreate()
PrptHtmlFile()
PrptTimeouts()  



-----8888888---there was more but i cut it----888888---

any suggestions
??

0
 

Accepted Solution

by:
mehman earned 0 total points
ID: 6224688
A file with the extension VBS is a VBScript file It can be run in the following ways
1. cscript.exe <filename>
2. wscript <filename>

Hope this answers your question

Regards
0
 
LVL 8

Expert Comment

by:Navid
ID: 6225308
mehman:
Unlock the question. You are not even close to the answer.
vikky999:
Please reject the answer if you want a real answer from us!
I think I can help you..
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:vikky999
ID: 6225438
hey navid..yep i need an answer anyway
although i found the creator
thanks

please help
0
 
LVL 8

Expert Comment

by:Navid
ID: 6225464
Excellent..
If running the pack:
1. cscript.exe <filename>
2. wscript <filename>
could help,
I appologize to mehman.
Glad you solved your problem..
Good luck
Navid
0
 

Author Comment

by:vikky999
ID: 6225501
no no...it didnt work i gave the points to mehman by mistake....could you help me please
0
 
LVL 6

Expert Comment

by:kahlean
ID: 6225888
even though if that work, that was taken from my previous comment.
0
 
LVL 6

Expert Comment

by:kahlean
ID: 6225891
vikky999, if you wish to solve this matter, post a question in CS for their support.
0
 
LVL 6

Expert Comment

by:kahlean
ID: 6225903
vikky999, as i had mention earlier, no matter you wanted to execute the vb script manually or automatically by a program you dont have to be worry about the file association, a vbs file can be executed no matter what fiel association it is.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6226055
Client accepted and closed this in error, I will refund these points.  Here is the link to the question requesting this.

for navid only....same vbs script???

http://www.experts-exchange.com/jsp/qShow.jsp?ta=win98&qid=20141328

Moondancer
Community Support Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6226067
These points have been refunded.

Moondanced
Community Support Moderator @ Experts Exchange
0
 
LVL 6

Expert Comment

by:kahlean
ID: 6226149
i think the exe file that is needed to run the vbs file might be onz.exe as what my assumption base on the vbs codes. Just type onz <vbs file name>
0
 

Author Comment

by:vikky999
ID: 6227114
ok kahlean ill try
thanks mr moondancer
0

Featured Post

Do email signature updates give you a headache?

Constantly trying to correctly format email signatures? Spending all of your time at every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

Join & Write a Comment

Update 11/3/2014 - Although the below article will get you to relocate the WINSXS folder, Microsoft has finally released a utility to reduce the size of the WINSXS folder. For some reason, it's not that straightforward. It only works on Windows 2008…
This is an article about Leadership and accepting and adapting to new challenges. It focuses mostly on upgrading to Windows 10.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now