Solved

srvany.exe application string too long

Posted on 2009-05-08
4
712 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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

733 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