Solved

Reading the Command$  {Urgent}

Posted on 1999-01-12
7
162 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

691 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