Link to home
Start Free TrialLog in
Avatar of Euro5
Euro5Flag for United States of America

asked on

VBS script from text file

I used to use a .vbs text file to schedule an daily activity (run a macro)
It isn't working now. No errors, just opens as a normal text file.
Anyone familiar with this? THANK YOU!

Refresh.vbs
Set objExcel = CreateObject("Excel.Application")
objExcel.Application.Run "'C:\Reports\Daily\Daily Dashboard.xlsm!'Module 1.Refresh"
objExcel.DisplayAlerts = False
objExcel.Application.Quit
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Any chance you have changed the association of the .vbs extension
Avatar of Euro5

ASKER

I think I used to open with Windows Script Host, but that is not an option under my "Open With"

I looked at my Windows Script Host and there is no Enable/Disable.
Avatar of Euro5

ASKER

Windows 10 Home 1909
Avatar of Euro5

ASKER

I enabled the Windows Script Host but still can't figure out how to open the txt file with script
here is my VBS file properties

User generated imageit opens with
User generated image
Avatar of Euro5

ASKER

I can't find that app - that is where I am stuck. I try the Change...
and search for Microsoft Windeows Based Script Host ===  nothing.
Could I NOT have it??
Avatar of Euro5

ASKER

User generated image
have a look at these
here they have registry fixes for vbs files...

https://www.winhelponline.com/blog/vbscript-files-open-with-notepad/
http://www.techsupportall.com/file-association-fix-for-windows-7/

or you can use this command to run vbs files

wscript.exe "drive:\path\filename.vbs"

Open in new window


in command window, when you run this

wscript.exe

what do you get?

or

wscript.exe /?

User generated image
Avatar of Euro5

ASKER

I did an ENABLE fix - but it didn't change anything.
Any suggestions?
Avatar of Euro5

ASKER

Also I can run
User generated image
so, you have everything but your registry entries gone, should be fixed...

I did an ENABLE fix - but it didn't change anything.

what did you do exactly for this?
there should be a reg file and you should run to fix registry entries...
or before running reg file try this

run this

where wscript

User generated image 
it will give you path...
then on a vbs file, shift + right click
you should see "open with"
then select this exe and mark "always run with this"

Avatar of Euro5

ASKER

When it wasn't working, there was a suggestion to add ENABLE, so I followed the steps and did that.
But I still couldn't see the Microsoft Windows Based Script Host.

If I could see it when I try to save my .txt file, I could just choose this option (as I see in your screenshot).
But I can't see the Microsoft Windows Based Script Host as an option OR find it by searching.

I can find the wscript.exe - but I don't think I should choose that - correct?
if you can find "open with" on a vbs file, then find the exe and select it
and mark it as "always open..."
after that, vbs files will open with that tool, which executes it instead of sending it to notepad...

Avatar of Euro5

ASKER

Ok, when I do that, I get the error

User generated image
but you are trying to associate txt file not a vbs!

open a windows explorer
enable extensions first

User generated image
the file, you show on screen is actually a text file
and the name is

Refresh.vbs.txt
ASKER CERTIFIED SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Euro5

ASKER

OMG YES!!!!!! THANK YOU!!! I forgot all about that view! THANK YOU!