How To run vb.net with vbs scheduled task

99封情书 提交于 2019-12-13 09:33:22

问题


I'm trying to run a windows scheduled task to open a .vb script, but when i run the task, it just opens the .vb script and does nothing else. Is there a .vbs script that will open my .vb script visual studio and run my sub?

I have a .vbs script that will open excel and run macros, just not sure how to do it with visual studio

The sub runs fine when i do it manually in visual studio

Thanks, Andy


回答1:


It does have something to do with VB.NET. Although it took me a day to see the real question.

How to run a VB.NET .vb file from vbs.

You have to compile it. Here's an article about how to do that.

appactivate between multiple internet explorer instances

Although the sample given doesn't work 7 and later because of a name conflict. Rename sendmail to something else for 7 and later.

If a limited user you need to manually add the registry entries to hkcu\software\classes. Do this by exporting as a reg file (regasm /reg) and search and replace HKEY_CLASSES_ROOT with HKEY_CURRENT_USER\Software\Classes and merge it with regedit or reg.

Also if you put in extra brackets around statements and subs vbscript code works in VB.NET mostly.

See this for how to run vbscript code in vb.net.

http://social.msdn.microsoft.com/Forums/en-US/adcae113-4758-481a-a367-60d5d14d97d6/this-is-how-to-turn-vbs-and-js-files-into-exe-files-from-the-command-line-without-third-party-tools?forum=scripting



来源:https://stackoverflow.com/questions/23835104/how-to-run-vb-net-with-vbs-scheduled-task

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!