Solved

Reading the Command$  {Urgent}

Posted on 1999-01-12
7
153 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

746 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

12 Experts available now in Live!

Get 1:1 Help Now