| View previous topic :: View next topic |
| Author |
Message |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Tue Nov 15, 2005 7:11 am Post subject: RUNH - How to pass quotes to command line |
|
|
I have a question. I have a dos application that needs command line options. I have tried passing %%directory which is in this case longer than 8.3 naming convention in DOS. However the DOS program needs to have the entire path in the runh command. Basically when I run the command in dos and quote the %%directory fully it works fine. When called from my VDS script it doesnt work.
The application test.exe C:\Program Files\ -l -a works from DOS.
If I do runh and call test.txt and pass C:\Program Files\ as %G it doesnt work. I have tried various quotes and double quote combinations with zero success. Hopefully I explained that and somebody out there knows what im trying to accomplish and can answer my question of how to I pass the full directory name correctly to my DOS command line program?
Thanks for your help..
WD _________________ K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux... |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Tue Nov 15, 2005 9:14 am Post subject: |
|
|
Did you try @shortname(%%directory)?
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Tue Nov 15, 2005 12:55 pm Post subject: |
|
|
Run @chr(34)C:\Program Files\App\app.exe@chr(34) -l -a
@chr(34) is the double quote character " |
|
| Back to top |
|
 |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Tue Nov 15, 2005 5:39 pm Post subject: Thanks Guys |
|
|
@chr(34) worked. I cant use the shortname as it looking for the full path... Problem was without the quotes it could'nt find it. Works like a champ now.
WD _________________ K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux... |
|
| Back to top |
|
 |
DavidR Contributor

Joined: 05 Aug 2003 Posts: 83 Location: Bethel Pennsylvania U.S.A.
|
Posted: Fri Nov 18, 2005 11:56 am Post subject: Shortname |
|
|
I have a little utility I keep on my Desktop for those times when I need the Dos acceptable name for a long complicated path and filenames that contain spaces etc.. Perhaps you will find this useful. Just copy and paste from the windows explorer address bar or type in the path manually.
.........David
| Code: | %A = @INPUT(Enter Full PathName)
info The Short Name is @shortname(%A)
Exit |
|
|
| Back to top |
|
 |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Fri Nov 18, 2005 5:41 pm Post subject: Thanks |
|
|
Yeah I found the @shortname in the help file after I posted the question but the quotes seem to have worked in this case. Still knowledge to keep in mind for future coding. _________________ K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux... |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Sat Nov 19, 2005 3:30 am Post subject: |
|
|
I expanded on David's example. I can copy the result to the clipboard. And after placing a shortcut to the exe in Window's "Send To" directory I can right-click and use Send To from Explorer to get a file or path's short name.
| Code: |
TITLE Short Name
if %1
%A = @shortname(%1)
else
%A = @INPUT(Enter Full PathName)
if @ok()
if @null(%A)
warn No Path Entered! ,
end
end
end
if %A
%R = @msgbox(@shortname(%A) @CR() @CR()Copy the shortname to the Clipboard? ,The Short Name is,$044)
if @equal(6,%R)
list create,1
list add,1,@shortname(%A)
list copy,1
end
end
exit
|
_________________ cheers
Dave |
|
| Back to top |
|
 |
|