Solved

srvany.exe application string too long

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Microsoft Surface -- Factory Reset ? 5 36
list all GPO's per container/OU 3 71
Access bios on restart 11 53
Printing issues after RDC session 3 16
The use of stolen credentials is a hot commodity this year allowing threat actors to move laterally within the network in order to avoid breach detection.
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

770 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