Re: My.Application.CommandLineArgs

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello,
Ok, I made my app make a log of it.. and this is what it gets when I select 6 files. (wrote every CommandLineArg followed by a vbCrLf just so I could read the log easier..)

D:\tmp\test - Copy (4) - Copy.txt
D:\tmp\test - Copy (6).txt
D:\tmp\test - Copy - Copy (4).txt
D:\tmp\test - Copy (5) - Copy.txt
D:\tmp\test - Copy (5).txt
D:\tmp\test - Copy - Copy (3).txt

If I select more then 6 files it wont do anything to the log.. because as I said.. it wont start the application... no runtime or anything..
Hold on an I'll go over to my XP machine and run the program.

Oh yeah, this is weird. I run the exact same program in the exact same way (through the sendto menu) and I just tried 38 files and it listed them all in the log file..

So its not the limitation of ComandLineArgs.. has to be some sort of compatibility issue with VS 2005 and Vista? hmm..


Thoughts?


"Stephany Young" <noone@localhost> wrote in message news:e6KpcWbUHHA.4252@xxxxxxxxxxxxxxxxxxxxxxx
If you are providing the commandline args via the SendTo mechanism then you obviously can't test this in the IDE.

I suggest you dump the input out to a file and see what you ACTUALLY have.

Something like:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim _ss As String = String.Empty

For Each _s As String In My.Application.CommandLineArgs
If _ss.Length > 0 The _ss &= " "
_ss &= _s
Next

Dim _sw As New IO.StreamWriter("xxx.log")

_sw.WriteLine(_ss)

_sw.Close

End Sub

Then post what you have in xxx.log here.


"Anders B" <anders@xxxxxxxxxxx> wrote in message news:ODvPJrZUHHA.3316@xxxxxxxxxxxxxxxxxxxxxxx
Ok, a bit of background. I am using my application on the "Send to" menu that you find when right clicking on a file in Explorer. And im picking up the selected files with the CommandLineArgs. And its working.. but as I said it will only give me the path of 6 files under Vista and when I tried on an XP machine I tried up to 10 files.. will see if I can do more.
For a test I've copied a bunch of text files that im selecting and sending to my app through the send to menu.

And right now im not doing much with the arguments in my application simply displaying them in a messagebox.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim i As Integer
Dim s As String
For i = 0 To My.Application.CommandLineArgs.Count - 1
s = My.Application.CommandLineArgs.Item(i)
MsgBox(s)
Next
End Sub


"Stephany Young" <noone@localhost> wrote in message news:O$IA5WZUHHA.3652@xxxxxxxxxxxxxxxxxxxxxxx
It's not limited to 6 on Vista by any means.

Working quite happily with 23 on

Windows 2000 Server
Windows 2000 Workstation
Windows XP
Windows 2003 Server
Windows Vista

Perhaps yuo might like to post the command line you are using because I'm sure that the problem is likely to be one or more of the characters in the string.


"Anders B" <anders@xxxxxxxxxxx> wrote in message news:OBsHuRZUHHA.4260@xxxxxxxxxxxxxxxxxxxxxxx
That really got me thinking..
And since I am trying Vista right now I thought, perhaps the problem lies there..
So I tried my app on an XP box and that worked like a charm.. tried 10 arguments.

Got any clue on what it might be that limits it to 6 under Vista? Hmm.

Developing under 2005 with service pack 1.


"Patrick Steele" <patrick@xxxxxxxx> wrote in message news:MPG.203efb2818e8b797989708@xxxxxxxxxxxxxxxxxxxxxxx
In article <e#tJpHGUHHA.3500@xxxxxxxxxxxxxxxxxxxx>, anders@xxxxxxxxxxxx
says...
Hmm, can "My.Application.CommandLineArgs" only contain 6 items?
I can't seem to get anything more out of it atleast.

I just tested it with 9 and it worked.

--
Patrick Steele
http://weblogs.asp.net/psteele





.



Relevant Pages

  • Re: System.Net.WebException
    ... My network hasnt a proxy buy I m working with the idea.... ... Why do you think that the ASP.NET app can connect and the conolse/windforns ... >> at Proceso.Proceso.MiRequest(String Method, String URL, String ... >> Dim res As HttpWebResponse ...
    (microsoft.public.dotnet.framework)
  • Active Directory gives up group info for only SOME users
    ... Our ASP.NET app is secured with forms authentication and validates users ... against Active Directory. ... Private _filterAttribute As String ... Dim entry As DirectoryEntry = New DirectoryEntry(_path, domainAndUsername, ...
    (microsoft.public.dotnet.security)
  • AD only gives up group (role) information for SOME users
    ... Our ASP.NET app is secured with forms authentication and validates users ... against Active Directory. ... Private _filterAttribute As String ... Dim entry As DirectoryEntry = New DirectoryEntry(_path, domainAndUsername, ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Connecting to ODBC DB at startup
    ... Oracle tables in the table list, it asks for an id and pass. ... The problem is when I go to run a query or do anything else in the app ... Dim cnConn As ADODB.Connection ... Dim strLogin As String ...
    (comp.databases.ms-access)
  • Re: Disable/Hide Minimum/Maximum/Close Items On the Access Runtime Application Window
    ... I tested opening the database and I can confirm that the main app close ... Dim CApplicationButtions As c_ApplicationButtons ... Dim wFlags As Long ...
    (microsoft.public.access.modulesdaovba)