2048 command line limit
-
Does anyone know how to get around the 2048 bytes limit on command line parameter list? I would like to drop a lot of files (infinite...) on my desktop icon. But if the resulting command line (files plus path) is larger than then 2048 bytes then VB crashes. I use Command$ to get the command line. /Jerry
-
Does anyone know how to get around the 2048 bytes limit on command line parameter list? I would like to drop a lot of files (infinite...) on my desktop icon. But if the resulting command line (files plus path) is larger than then 2048 bytes then VB crashes. I use Command$ to get the command line. /Jerry
Did you try using the Win32 API function GetCommandLine ? Furor fit laesa saepius patientia
-
Did you try using the Win32 API function GetCommandLine ? Furor fit laesa saepius patientia
Have you tried it? I think not. I placed MsgBox "Hello" in the first line of Form_Load(). You can't even get that line to work. The same behaviour occur in C++ projects also if you try the same thing. It is a Windows problem. If you have a solution that works, please post it. /Jerry
-
Have you tried it? I think not. I placed MsgBox "Hello" in the first line of Form_Load(). You can't even get that line to work. The same behaviour occur in C++ projects also if you try the same thing. It is a Windows problem. If you have a solution that works, please post it. /Jerry
Well, I've tried this in VB and in Window 2k SP2 (my machine) it runs fine... Maybe is the drag & drop thing your problem... Compile to an .EXE and run the .EXE. The first time it shows 0 (obvious) and the subsequent times, it shows 5000. To exit program, kill its task ;P
Option Explicit Private Sub Form_Load() > MsgBox "Hello World" MsgBox Len(Command$) Shell App.Path & "\" & App.EXEName & " " & String$(5000, "x") Unload Me End Sub
Furor fit laesa saepius patientia -
Well, I've tried this in VB and in Window 2k SP2 (my machine) it runs fine... Maybe is the drag & drop thing your problem... Compile to an .EXE and run the .EXE. The first time it shows 0 (obvious) and the subsequent times, it shows 5000. To exit program, kill its task ;P
Option Explicit Private Sub Form_Load() > MsgBox "Hello World" MsgBox Len(Command$) Shell App.Path & "\" & App.EXEName & " " & String$(5000, "x") Unload Me End Sub
Furor fit laesa saepius patientiaTried it, doesn't work. I don't think you are doing what I am doing. Build your program, create a shortcut and place that on your desktop. Create a directory with a long path, place a lot of files in it. Select them all and drop them on your shortcut, make sure that resulting commandline will be larger than 2048 bytes. Your program will show a MsgBox saying :"Access to the specified device, path or file is denied." /Jerry
-
Tried it, doesn't work. I don't think you are doing what I am doing. Build your program, create a shortcut and place that on your desktop. Create a directory with a long path, place a lot of files in it. Select them all and drop them on your shortcut, make sure that resulting commandline will be larger than 2048 bytes. Your program will show a MsgBox saying :"Access to the specified device, path or file is denied." /Jerry
I am not trying to be smart. If you have a solution a will be very happy. I'm looking at sending files to a directory and use FindFirstChangeNotification() to find out if files have been copied. Then just run through the catalog with FileFind. Cons: The files will be copied. Can that be hindered? Or sending the files to a .bat file, list the files to a text file and read that. Cons: A DOS window will be shown, it will look bad on a slow machine. /Jerry
-
I am not trying to be smart. If you have a solution a will be very happy. I'm looking at sending files to a directory and use FindFirstChangeNotification() to find out if files have been copied. Then just run through the catalog with FileFind. Cons: The files will be copied. Can that be hindered? Or sending the files to a .bat file, list the files to a text file and read that. Cons: A DOS window will be shown, it will look bad on a slow machine. /Jerry