forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


RUNH - How to pass quotes to command line

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
webdaddy
Contributor
Contributor


Joined: 14 Nov 2004
Posts: 151
Location: Raleigh NC

PostPosted: Tue Nov 15, 2005 7:11 am    Post subject: RUNH - How to pass quotes to command line Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Tue Nov 15, 2005 9:14 am    Post subject: Reply with quote

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
View user's profile Send private message
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Tue Nov 15, 2005 12:55 pm    Post subject: Reply with quote

Run @chr(34)C:\Program Files\App\app.exe@chr(34) -l -a

@chr(34) is the double quote character "
Back to top
View user's profile Send private message Send e-mail
webdaddy
Contributor
Contributor


Joined: 14 Nov 2004
Posts: 151
Location: Raleigh NC

PostPosted: Tue Nov 15, 2005 5:39 pm    Post subject: Thanks Guys Reply with quote

@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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
DavidR
Contributor
Contributor


Joined: 05 Aug 2003
Posts: 83
Location: Bethel Pennsylvania U.S.A.

PostPosted: Fri Nov 18, 2005 11:56 am    Post subject: Shortname Reply with quote

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
View user's profile Send private message
webdaddy
Contributor
Contributor


Joined: 14 Nov 2004
Posts: 151
Location: Raleigh NC

PostPosted: Fri Nov 18, 2005 5:41 pm    Post subject: Thanks Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Sat Nov 19, 2005 3:30 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group