Solved

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

Posted on 2001-06-25
20
361 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
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 
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
 

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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

829 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