Process info - ArgumentList is limited when using user domain and password?
Hi,
Process info - ArgumentList is limited when using user domain and password?
Thanks in adavnce,
.NET
-
Dani_S 3,826 Reputation points
2024-04-10T06:31:28.03+00:00 -
Dani_S 3,826 Reputation points
2024-04-10T07:49:08.54+00:00 I pass item to argument list this path @"D:\ffffffffffffffffffffffffghffhfgjfghkjhjfghkjhkgghkloyuilhnbfghkytoncksdgiosdvjkfli;lasdgj;lfdjglj;fdlgfdhhkfhgkdgjhkhgjkhjghsffffffffffffffffftuiytuirytiuyrihjhgjh44gjfhjfjghfjkgkjshgjkhfdgkjhkjdfhgkjfghsklhgxt.txt"
include ; and is not passed to the process why ?
-
Jiale Xue - MSFT 47,661 Reputation points • Microsoft Vendor
2024-04-10T08:23:52.57+00:00 Hi @דני שטרית , Welcome to Microsoft Q&A,
Please don't use screenshots, give minimal reproduction code. What error message did you encounter? I don't quite understand what you want to do at the moment.
-
Dani_S 3,826 Reputation points
2024-04-10T08:36:14.9133333+00:00 OK. I tried to write code but I blocked.
i have app, i check files, and keep their path in concat List<string>
then i copy then to ArgumentList of processinfo.
when i select long file i provide before or alot of files the process not fire.
-
Dani_S 3,826 Reputation points
2024-04-10T08:45:42.96+00:00 My aim to pass list of files short and long to ArgumentList of processinfo.
How to do it efficency ?
-
Jiale Xue - MSFT 47,661 Reputation points • Microsoft Vendor
2024-04-10T08:46:36.89+00:00 Hi @דני שטרית ,
So you currently have no code to reproduce? And it doesn't give any error message? The information I got so far is that the path you are trying to add argument to is too long and cannot run. Can you use environment variables or relative paths to replace this too long path, or split the too long argument?
-
Dani_S 3,826 Reputation points
2024-04-10T08:49:32.5966667+00:00 exit code -1.
-
Dani_S 3,826 Reputation points
2024-04-10T08:54:46.2833333+00:00 When i check the app of the process this long file upload but when i pass it throgh process is not work. The long path is in the root of D drive.
What do you mean relative paths? can you supply code?
Regarding error how i get the error message from process, exit code?
-
Jiale Xue - MSFT 47,661 Reputation points • Microsoft Vendor
2024-04-10T08:59:02.7733333+00:00 Do you mean the process works when using files with short names? This can determine your problem and whether the current user has permission to operate.
-
Dani_S 3,826 Reputation points
2024-04-10T09:02:46.7533333+00:00 Yes works with short names and my user has permission.
what with long file name or long list ?
Why is not working with long file name or long list of
ArgumentList of processinfo
-
Jiale Xue - MSFT 47,661 Reputation points • Microsoft Vendor
2024-04-10T09:10:44.49+00:00 What about this code?
// List of file names (potentially long) string[] fileNames = { "File1WithALongName.txt", "File2WithAVeryLongName.txt", "File3WithAnotherLongName.txt" }; // Construct a single string containing all file names separated by spaces string fileNamesString = string.Join(" ", fileNames.Select(fileName => $"\"{fileName}\"")); // Set the current directory of the process to a shorter path Environment.CurrentDirectory = @"C:\";
-
Dani_S 3,826 Reputation points
2024-04-10T09:22:35.3233333+00:00 Two problems:
- File name can be long as I gave you in other post.
- string has a limit on its long.
- I was using ? as join seprator since is not valid charcter of file name. since I need to split it in target app.
-
Dani_S 3,826 Reputation points
2024-04-10T09:25:19.2633333+00:00 - I can use argumentList with files name + current directory to limit the problem is it ?
-
Dani_S 3,826 Reputation points
2024-04-10T09:55:12.6566667+00:00 I did and it works better now.
foreach (var item in concatFiles)
{
psi.ArgumentList.Add(new FileInfo(item).Name);
}
psi.WorkingDirectory = tempFolderFullPath;
-
-
Dani_S 3,826 Reputation points
2024-04-10T10:43:41.1533333+00:00 In debug I got:
System.ComponentModel.Win32Exception: 'An error occurred trying to start process 'C:\GssdDesktopClient\ExternalApps\BurnMedia\BurnMedia.exe' with working directory 'C:\GssdDesktopClient\ExternalApps\CopyTempFolder'. The parameter is incorrect.'
-
Dani_S 3,826 Reputation points
2024-04-10T15:43:47.18+00:00 Argument list is limited instead of passing all the file path or name in relative way I pass the path where all files reside and do Directory.getfiles to get all pathes.
-
Jiale Xue - MSFT 47,661 Reputation points • Microsoft Vendor
2024-04-11T09:41:14.8+00:00 If large quantities don't work, then you can choose to split it up and do it in groups. Whether the path length can be read also depends on the computer, you need to try to shorten it.
-
Dani_S 3,826 Reputation points
2024-04-11T11:31:07.7333333+00:00 How is can be done in group?
-
Jiale Xue - MSFT 47,661 Reputation points • Microsoft Vendor
2024-04-19T09:44:25.9+00:00 Is there any update in this issue?What's the latest progress?
-
Dani_S 3,826 Reputation points
2024-04-24T10:40:11.5466667+00:00 The problem solved.
Instead of passing in ArgumentList all files names in relative way.
I passed the path where are located this file in ArgumentList.
And in the process inside, i used Directory.Getfiles to get all files.
Thanks you very much.
-
Dani_S 3,826 Reputation points
2024-05-19T07:53:23.85+00:00 You can close the ticket!!!!
Sign in to comment