|
-
Aug 7th, 2010, 11:46 PM
#5
Re: Show All String Characters
explorer will append (& prepend) quotes to all filepaths containing spaces (only), these will be in your command string
if you are passing multiple files, you can not split on space alone (unless you are sure that there are no spaces within the filepath)
i have posted 2 slightly different codes in the forums, recently, which should be able to return the filenames from the command string, i will see if i can find either
this example is not specifically for command string, but should work
vb Code:
q = Chr(34) d = " " myarr = Split(Command, d) For i = 0 To UBound(myarr) If i > UBound(myarr) Then Exit For If InStr(myarr(i), q) > 0 Then j = 1 Do myarr(i) = myarr(i) & d & myarr(i + j) If InStr(myarr(i + j), q) > 0 Then myarr(i) = Replace(myarr(i), q, "") For k = i + 1 To UBound(myarr) - i myarr(k) = myarr(k + j) Next ReDim Preserve myarr(k - 1) Exit Do End If j = j + 1 Loop End If Next
the other i did, was to do exactly what you are wanting and checked for valid files, do search on command
Last edited by westconn1; Aug 7th, 2010 at 11:55 PM.
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|