Solved

Reading the Command$  {Urgent}

Posted on 1999-01-12
7
154 Views
Last Modified: 2012-05-04

I have a problem with the Command$ string when
launching my application. Problem is as follows,
I get the file in the MS DOS string format.
C:\My Worksh~1\Java\This Direct~1\Frame~1.JAV

I would like to know if their is a way of forceing
the full path to the Command$ so that the above example
can look like this...
C:\My Workshop\Java\My Directory\Frame.Java

Thanks
0
Comment
Question by:vienna
  • 3
  • 3
7 Comments
 
LVL 12

Expert Comment

by:mark2150
ID: 1455849
It should pass in what you put on the line verbatim. How are you triggering your program? If it's from a batch file then the command interpriter is doing it and not the VB.

Try creating a batch that explicitly sticks in what you want.

M

0
 
LVL 3

Expert Comment

by:idt
ID: 1455850
According to Microsoft:

in the association dialog View.Options.FileTypes..

if you define the application and arg as:
C:\ThePath\TheExe.exe %1
then you will get the 8.3

if you define it as
"C:\ThePath\TheExe.exe" "%1"
then you will get long file names

I created a simple VB5 app that does nothing 'cept MsgBox(Command$) and interestingly enough, I got long file names in both situations.  Pls note that I am running NT srvPack4, not that it should make a difference.

Hope this helps

0
 
LVL 3

Expert Comment

by:idt
ID: 1455851
if you are interested it was Article ID: Q150706 via support online.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 10

Accepted Solution

by:
caraf_g earned 10 total points
ID: 1455852
vienna,

I haven't got time to write out the exact code but the gist of it is the following:

1 Use Dir$ to get the long name of each sub directory
2 Use Instr to find the slashes (/) in your Command$ string

This way you can get "Frame1.Java" if you put in the full Command$, then remove everything from the last slash onwards to get "My Directory" (use vbDirectory in the Dir$ statement), remove the next slash and everything onwards to get "Java" and so on in a loop until you've hit the <drive>: bit.

Hope this helps
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 1455853
Erm... for something so urgent you don't seem to be in much of a hurry evaluating the answer and the comments?
0
 
LVL 3

Expert Comment

by:idt
ID: 1455854

'ping'


0
 
LVL 10

Expert Comment

by:caraf_g
ID: 1455855
load 'em torpedoes cap'n we bein' pinged!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now