Solved

srvany.exe application string too long

Posted on 2009-05-08
4
696 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
  • 2
4 Comments
 
LVL 95

Accepted Solution

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

Author Comment

by:ultramoo
Comment Utility
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
Comment Utility
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
Comment Utility
Looks like OS limitation is the case. I'll have to work with somthing similar to batch files.

Thanks.
0

Featured Post

Wish Marketing would stop bothering you?

Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

Join & Write a Comment

For a variety of reasons, it sometimes makes sense to reboot a Windows-based computer on a regular, perhaps daily basis. This "cures" a lot of ills by resetting processes, flushing caches, refreshing memory, and reestablish network connections. In a…
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
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). …

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now