Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2008, 11:55 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default How to auto. Start App As User on Server?

I have an app, DFC.EXE, which is on a “Windows Server 2003” server, and is used by an internet app on that server.

I want DFC to be running anytime the server (by which I mean the machine throuhgout this question, not the internet server) is running. Additionally, I want it running under a specific user account.

How can this be done?
 
Old April 18th, 2008, 12:23 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

HI there..

can you clarify a little?

You have PC A (server) with dfc.exe
You have PC B (client) that conects to a web page (or something similar) via internet

Is this correct?

And you want to execute something on A every time B starts under some account?

Is this some kind of key logger or something similar?

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old April 18th, 2008, 12:33 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

DFC runs constantly on the server with the inet server. DFC sleeps for 5 seconds, wakes up and looks in a certain location on the server for a data file. If not found, go back to sleep. Repeat.
If the file is found, get the parameters out of it, and create an output file from the data.
Check for another file; if none, go back to sleep.

Separately, on the box, the internet app can write one of those data files that DFC looks for, and can find the resultant output file. The Inet app has no additional contact with DFC.

Better?
 
Old April 18th, 2008, 12:40 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Quick idea, can you just put DFC into the registry under that user account so it start every time that particular user log in?

Or just start it with windows (under any account) and check what user log in and if it not the rigth one finished it? (no clue on how to know what user log in.)

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old April 18th, 2008, 12:45 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I need this app to run as a specific user (a local account on the server) when the box is started, even when no one is logged on. (Remember, this is a server, not a workstation.)
 
Old April 18th, 2008, 12:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Then I'm out, I don't know how to run something before you are logged in (but for sure you can). Can you just install it at a service? services has permission.

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old April 18th, 2008, 01:01 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Yeah, there's a way to run an non-service as a service by using the wrapper “SRVANY.EXE,” installed as a service with the name you chose (let’s say running 123.exe as "TheGoob": INSTSRV TheGoob c:\tools\srvany.exe).

After installing the srvany with the name you like, you have to go into the registry and set up "TheGoob" with the particulars of 123.exe—path, name, etc.—and set up the service through Control Panel for the account that it is to use, and whether it is to be automatic, manual, etc.

This is all very complex. I'm hoping there is a vastly simpler way to do this...
 
Old April 18th, 2008, 01:10 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

No clue on a simple way, sorry to not be more helpfull.

Well I have an insane idea. What if you modify the inet app so when IIS start and you have the app loading event (at least in asp) you call up the exe, and you put the permitions to the exe file?

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old April 23rd, 2008, 04:31 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Brian,

You could try using the Scheduled Task Wizard that is available off of the Control Panel.
This will allow you to start up the app and set the account.

No guarantee that this will do what you want, but it should give you a fun half hour figuring out if it does.

What you really want is a windows service - which is a lot of work and hassle to do in VB6, and which is also not very stable using VB6 no matter how you approach it. The next best thing is to write your service in C# or VB.NET - in which case it is very easy and will work well. VB6 was never intended to do this sort of thing, and while VB6 is very powerful and very easy in a lot of ways, it does have it's limitations.

Cheers...

Woody Z
http://www.learntoprogramnow.com
How to use a forum to help solve problems
My blog... please visit
 
Old April 25th, 2008, 04:40 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

In fact, that is exactly what I did. That method allows you to specify the user account that the app will run under. One of the schedule options (along with every hour, every day, etc.) is on startup. Perfect.

I was trying to free up the time to come back here and post that, but...

I did start to try to run this in the RunAsAny.exe wrapper, but it all just got too complex.

Unfortunately I am under extremely severe restrictions on creating a new gizmo. We are under an interim Authority To Operate on the network, and cannot change anything until it becomes the real deal, rather than interim...





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Auto Start Windows Service virendar23 C# 2005 3 September 15th, 2011 03:16 PM
How to Auto Start Windows Service virendar23 .NET Framework 2.0 5 April 18th, 2008 11:43 AM
Can't start my app in tomcat xpan Apache Tomcat 3 January 7th, 2007 05:26 AM
SQL Server "Service Manager" Auto Start Problem. khalidumer SQL Server 2000 0 May 18th, 2004 09:21 AM
auto start smukher Pro VB 6 2 October 15th, 2003 01:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.