Advertisement

05.14.2005 at 07:52AM PDT, ID: 21424323
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.2

ShellWindows Won't Work as a service or as a scheduled task or as a SQL Server Enterprise Package

Asked by tjeffryes in Visual Basic Programming

Tags: ,

Okay, the title gives the basic problem, but I'll give a little more history because there may be solutions out there not requiring shdocvw.dll.

The problem in a nutshell:
I need to get the URL's of all open Explorer windows.  Using ShellWindows, this is incredibly easy and is documented in a number of places on this site.  Program works fine.  However, as soon as I try to run the program as a schedule task or as a SQL Server Package, it fails when trying to create the ShellWindows object (429 activex can't create control).  I've also tried some stuff that makes my program a "service" via some kind of proxy and set it to "use the desktop", but it still fails.  

The program is a simple vb executable that launches a vb activex exe.  The activex exe is what uses the shellwindows object.

First off, I have read http://www.experts-exchange.com/Programming/Q_20887870.html?query=shellwindows&clearTAFilter=true.  It sounds as if this guy came up with a solution, but I don't understand it.  I ran the code he provided and got a nice messagebox with some Token ID, but I don't know what the hell a token is (other than something to ride a subway with) and I would not know how to get a hold of an Internet Explorer object using merely this token value.  So there's one possible solution, if anyone can help there.

The history of what I'm actually trying to do:
There are some files out there on the internet that are in CSV format.  I want a program to run nightly on one of our organization's servers, unattended.  The program needs to run under its own login or under the System login.  The program automates Internet Explorer and navigates to the URL of the CSV file.  To bypass the download dialog, I have set the properties for CSV files in Windows to be opened in Internet Explorer by default (great trick).   What happens then, however, is that a new window is spawned and the CSV file appears in the new window.  Also, the URL in the Address bar is NOT the URL where the CSV file was originally, but instead shows the path to the newly downloaded CSV file in the Internet Cache.  That's all and good, so long as I can figure out that path.  To get that path, I use shellwindows to loop through all open windows and search for the name of the file I'm looking for within each URL (fortunately, I do know the name of the file I'm looking for).   Once I get the path to the file, I can copy it to the location I really want it to be in and begin a nightly processing job.

Before I discovered the ShellWindows method, I did have an alternate method.  This was to find the root of the Internet Cache and simply loop through all the files there until I found the one I need.  This of course takes longer and I found that oftentimes the file I wanted was in a "locked" state and I could not copy it.  

If I cannot figure out how to get this program to run unattended on a server, I will have to revert to the old method of looping through the cache, and I really don't want to do that.

The programs runs FINE when I run it directly.

I give the entire history here because the overall goal is to get these files off the internet.  The vendor refuses to provide the files via ftp, so I am stuck with CSV files located on a server.  so if there are any other approaches out there, please chime in.

Also, another way I could get the URL might be:  since I'm already automating IE to navigate to the CSV file, one would think that I could use automation to get the URL of the new Window.  However, I can't find any way using the Internet Explorer object model to find instances of new windows spawned by the original instance, especially if the new window ends up being more like a Windows Explorer window than an Internet Explorer window.  

TJStart Free Trial
 
Keywords: ShellWindows Won't Work as a servi…
 
Loading Advertisement...
 
[+][-]05.14.2005 at 08:02AM PDT, ID: 14002726

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.14.2005 at 08:39AM PDT, ID: 14002837

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.14.2005 at 08:49AM PDT, ID: 14002858

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.14.2005 at 05:13PM PDT, ID: 14003983

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.14.2005 at 05:52PM PDT, ID: 14004103

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.14.2005 at 06:08PM PDT, ID: 14004153

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Visual Basic Programming
Tags: shellwindows, object
Sign Up Now!
Solution Provided By: MarkSteward
Participating Experts: 3
Solution Grade: A
 
 
[+][-]05.14.2005 at 06:21PM PDT, ID: 14004185

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.15.2005 at 04:52AM PDT, ID: 14005497

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.15.2005 at 02:30PM PDT, ID: 14007134

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.15.2005 at 02:39PM PDT, ID: 14007152

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.15.2005 at 02:56PM PDT, ID: 14007195

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.15.2005 at 03:18PM PDT, ID: 14007230

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.15.2005 at 03:46PM PDT, ID: 14007277

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.16.2005 at 05:23AM PDT, ID: 14009505

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2005 at 06:53AM PDT, ID: 14010287

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32