Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. 2048 command line limit

2048 command line limit

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
7 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jerkan
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • J Jerkan

      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

      D Offline
      D Offline
      Daniel Turini
      wrote on last edited by
      #2

      Did you try using the Win32 API function GetCommandLine ? Furor fit laesa saepius patientia

      J 1 Reply Last reply
      0
      • D Daniel Turini

        Did you try using the Win32 API function GetCommandLine ? Furor fit laesa saepius patientia

        J Offline
        J Offline
        Jerkan
        wrote on last edited by
        #3

        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

        D 1 Reply Last reply
        0
        • J Jerkan

          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

          D Offline
          D Offline
          Daniel Turini
          wrote on last edited by
          #4

          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

          J 1 Reply Last reply
          0
          • D Daniel Turini

            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

            J Offline
            J Offline
            Jerkan
            wrote on last edited by
            #5

            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

            J 1 Reply Last reply
            0
            • J Jerkan

              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

              J Offline
              J Offline
              Jerkan
              wrote on last edited by
              #6

              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

              J 1 Reply Last reply
              0
              • J Jerkan

                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

                J Offline
                J Offline
                Jerkan
                wrote on last edited by
                #7

                I have found a way to achieve dropping on the desktop. Look at shell extensions part VI on this site. /Jerry

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups