Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Reading the Command$  {Urgent}

Posted on 1999-01-12
7
Medium Priority
?
172 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 10

Accepted Solution

by:
caraf_g earned 20 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

650 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