Euro5
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
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
Any chance you have changed the association of the .vbs extension
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.
I looked at my Windows Script Host and there is no Enable/Disable.
ASKER
Windows 10 Home 1909
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
it opens with
it opens with
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??
and search for Microsoft Windeows Based Script Host === nothing.
Could I NOT have it??
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
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"
in command window, when you run this
wscript.exe
what do you get?
or
wscript.exe /?
wscript.exe
what do you get?
or
wscript.exe /?
ASKER
ASKER
I did an ENABLE fix - but it didn't change anything.
Any suggestions?
Any suggestions?
so, you have everything but your registry entries gone, should be fixed...
what did you do exactly for this?
there should be a reg file and you should run to fix registry entries...
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
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"
run this
where wscript
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"
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?
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...
and mark it as "always open..."
after that, vbs files will open with that tool, which executes it instead of sending it to notepad...
but you are trying to associate txt file not a vbs!
open a windows explorer
enable extensions first
open a windows explorer
enable extensions first
the file, you show on screen is actually a text file
and the name is
Refresh.vbs.txt
and the name is
Refresh.vbs.txt
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OMG YES!!!!!! THANK YOU!!! I forgot all about that view! THANK YOU!