Solved

srvany.exe application string too long

Posted on 2009-05-08
4
717 Views
Last Modified: 2013-12-28
I use srvany.exe to run some of my applications as services.

Its been working great for years until recently when I wanted to add another application with a long parameter value:

eg: c:\myapp\myapp.exe -parameter1 -parameter2 ....... -parameterN
      <------------------------------- Too Long -------------------------------->
(Limited to 260 Looks like it)

Its fine when I execute it from Command Prompt.. just not via srvany.

Does anyone know a way to fix this? Is there any source code for srvany.exe? Maybe I can edit it to accept longer strings.
0
Comment
Question by:ultramoo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 96

Accepted Solution

by:
Lee W, MVP earned 250 total points
ID: 24334616
Just a thought - put the string into a batch file - then make the batch file the service...
0
 

Author Comment

by:ultramoo
ID: 24334655
The only problem with that is when "closing the service" scenario. It would only close the batch file but not the acutal application.

So the appliction would still be running.

And if sombody clicks the start service, it would then run multiple instances.



0
 
LVL 22

Assisted Solution

by:Adam Leinss
Adam Leinss earned 250 total points
ID: 24335463
This is an OS limitation: http://msdn.microsoft.com/en-us/library/aa365247.aspx
"In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:\<some 256 character path string><NUL>" where "<NUL>" represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string."
0
 

Author Closing Comment

by:ultramoo
ID: 31579369
Looks like OS limitation is the case. I'll have to work with somthing similar to batch files.

Thanks.
0

Featured Post

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
Determining the an SCCM package name from the Package ID
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question