Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

srvany.exe application string too long

Posted on 2009-05-08
4
Medium Priority
?
732 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 1000 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 1000 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

A small collection of useful tips and tricks for Windows 10 users that I decided to write as a result of recent questions that were asked and answered at Experts Exchange. Two short video tutorials included. Enjoy..
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
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…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

636 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