473,883 Members | 2,150 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting command line arguments for a service at install time

I would like to set command line arguments to a service at install time. I
need to do this because I need to get information from different registry
locations depending on my command line argument. I have to do it this way as
the consumer of the service should not be able to change the argument -
except by uninstalling and reinstalling the service.

I created the service and the service itself works great. However, when I
try to install the service I get the following error:

"System.IO.File NotFoundExcepti on: File or assembly name BDCC, or one of its
dependencies, was not found."

The command I am using to install the service is:
installutil StartUpParams.e xe -a BDCC

I have also tried the following with no success:
installutil "StartUpParams. exe -a BDCC"
installutil [StartUpParams.e xe -a BDCC]
installutil "StartUpParams. exe" -a BDCC
installutil "StartUpParams. exe" "-a BDCC"

Is there any way I can install the service with command line arguments? I
don't want to use "Start Parameters" from "Service Properties" as the end
user can change the the parameter without uninstalling the service first.

Nov 21 '05 #1
1 7908
I was able to get to the install the service with command line arguments
using Installshield. However, I discovered that the command line arguments
are not passed to the OnStart mnethod of the service. Only the arguments
specified in the "startup parameters" section is passed to the service.

If you want to access the command line arguments for the service, the MAIN
subroutine must be overloaded with the arguments parameter [I just copied and
pasted the code from the OnStart method].
"amirmira" wrote:
I would like to set command line arguments to a service at install time. I
need to do this because I need to get information from different registry
locations depending on my command line argument. I have to do it this way as
the consumer of the service should not be able to change the argument -
except by uninstalling and reinstalling the service.

I created the service and the service itself works great. However, when I
try to install the service I get the following error:

"System.IO.File NotFoundExcepti on: File or assembly name BDCC, or one of its
dependencies, was not found."

The command I am using to install the service is:
installutil StartUpParams.e xe -a BDCC

I have also tried the following with no success:
installutil "StartUpParams. exe -a BDCC"
installutil [StartUpParams.e xe -a BDCC]
installutil "StartUpParams. exe" -a BDCC
installutil "StartUpParams. exe" "-a BDCC"

Is there any way I can install the service with command line arguments? I
don't want to use "Start Parameters" from "Service Properties" as the end
user can change the the parameter without uninstalling the service first.

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2619
by: Hari | last post by:
can i have command line arguments in VS.NET applicatio? if yes how? Can i have some code snippets of the above functionality? I know we can acjieve this in console application form command prompt but how can i achieve it in an application in VS.NET? Thank you
1
2075
by: rforman1 | last post by:
I have found many threads with this question asked and ostensibly answered, but none with an example of how exactly to do it. Help! I know that in order to set up the values of command line arguments from within the IDE, I go to Project Properties, Configuration Properties, and then the text box labeled "Command Line Arguments" under the label "Start Options." But what exactly do I put into that text box? What I want to do is set up a...
6
628
by: Jon Hewer | last post by:
hi i am writing a little script and currently implementing command line arguments following the guide by mark pilgrim from dive into python; http://diveintopython.org/scripts_and_streams/command_line_arguments.html thats all fine, however i am not sure of the BEST way to handle multiple command line arguments
7
4743
by: Steve M | last post by:
I'm trying to invoke a Java command-line program from my Python program on Windows XP. I cannot get the paths in one of the arguments to work right. The instructions for the program describe the following for the command-line arguments: java -jar sforcedataloader.jar -Dsalesforce.config.dir=CONFIG_DIRECTORY They also give an example:
1
9650
by: mriedel | last post by:
I'm using the InstallContext class to parse the command-line arguments of a console application. The arguments are in the form of "-file=myFile.txt -flag", and the InstallContext object gives me what I need through the Parameters and IsParameterTrue properties. However, I can't find any documentation or code samples that confirm that this is an acceptable use of the InstallContext class. I understand the need to use Regex or some other means...
3
5420
by: Shailesh Humbad | last post by:
I want to set a command-line argument for a Windows service that I programmed in VB.Net. This ought to be available from the service installer classes, but I can not find any such property. What I end up having to do is modify the registry directly from a separate installer program, which from a deployment perspective is--let's just say less than optimal. The second problem I have is that when the Win2K service control manager runs...
2
16481
by: Russ P. | last post by:
Is it possible to pass command-line arguments when running a program in IDLE? The "Run" menu does not seem to provide that option. Thanks.
4
7470
by: Keith Hughitt | last post by:
Hi all, I am using someone else's script which expects input in the form of: ./script.py <arg1arg2 I was wondering if the angle-brackets here have a special meaning? It seems like they specify an input and output stream to use in place of the console. I could not
4
9244
by: tvrdak | last post by:
Hello, I would like to register service to start with some arguments - meaning command line arguments of service itself. The best approach was some articles about selfregistrating service, like f.e. http://alt.pluralsight.com/wiki/default.aspx/Craig/SelfInstallingService.html In this case I had assembly executable and could add my parameter at the end, but unfortunately registration itself closed it into dobulequotes :(, so result was...
0
9945
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9798
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10766
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10863
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10422
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7978
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5807
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6007
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.