[OT] Windows Command Help

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

[OT] Windows Command Help

Dan Shafer
In OS X, I can issue the shell command "launch" followed by a  
document path and the system opens that document with the appropriate  
app.

Is there an equivalent command/syntax for Windows? I tried "start"  
but if I give it a document path, it opens a new command window but  
doesn't do anything.

Thanks in advance for any help for the Windows-challenged.




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dan Shafer, Revolution Consultant and Author
http://www.shafermedia.com
Get my book, "Revolution: Software at the Speed of Thought"
 From http://www.revolutionpros.com, Click "My Stuff"



_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

RE: [OT] Windows Command Help

MisterX
Hi Dan

It's funny to see MacOS - no-to-CLIs - crowd do it in Unix and not in DOS ;0

what you need is something like
c:\notepad <pathtomyfile>
or notepad.exe <path to myfile"
or <pathtoapp> <path to file> should work...

BUT this will block Rev... :(

so shell("start" && quote && appspath && docpath && quote should work...)

cheers
Xavier

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of
> Dan Shafer
> Sent: Friday, July 29, 2005 02:57
> To: Revolution List
> Subject: [OT] Windows Command Help
>
> In OS X, I can issue the shell command "launch" followed by a
> document path and the system opens that document with the
> appropriate app.
>
> Is there an equivalent command/syntax for Windows? I tried "start"  
> but if I give it a document path, it opens a new command
> window but doesn't do anything.
>
> Thanks in advance for any help for the Windows-challenged.
>
>
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Dan Shafer, Revolution Consultant and Author
> http://www.shafermedia.com Get my book, "Revolution: Software
> at the Speed of Thought"
>  From http://www.revolutionpros.com, Click "My Stuff"
>
>
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage
> your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Windows Command Help

mwieder
MisterX-

Thursday, July 28, 2005, 6:24:36 PM, you wrote:

M> It's funny to see MacOS - no-to-CLIs - crowd do it in Unix and not in DOS ;0

I agree. My first experience with a Mac in 1984 was something similar.
"Where's the command line?", "How do you delete a file?", etc. I had
to be shown step by step.

But...

get shell("start" && tPathToDocument) -- works for me

--
-Mark Wieder
 [hidden email]

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
--
 Mark Wieder
 ahsoftware@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Windows Command Help

Dan Shafer
In reply to this post by MisterX
The problem is I don't know the name or path of the app. On OS X,  
this doesn't matter. But it appears I cannot ask Windows to launch a  
document and expect it to figure out which app to use.

Great.

Dan

On Jul 28, 2005, at 6:24 PM, MisterX wrote:

> Hi Dan
>
> It's funny to see MacOS - no-to-CLIs - crowd do it in Unix and not  
> in DOS ;0
>
> what you need is something like
> c:\notepad <pathtomyfile>
> or notepad.exe <path to myfile"
> or <pathtoapp> <path to file> should work...
>
> BUT this will block Rev... :(
>
> so shell("start" && quote && appspath && docpath && quote should  
> work...)
>
> cheers
> Xavier
>
>
>> -----Original Message-----
>> From: [hidden email]
>> [mailto:[hidden email]] On Behalf Of
>> Dan Shafer
>> Sent: Friday, July 29, 2005 02:57
>> To: Revolution List
>> Subject: [OT] Windows Command Help
>>
>> In OS X, I can issue the shell command "launch" followed by a
>> document path and the system opens that document with the
>> appropriate app.
>>
>> Is there an equivalent command/syntax for Windows? I tried "start"
>> but if I give it a document path, it opens a new command
>> window but doesn't do anything.
>>
>> Thanks in advance for any help for the Windows-challenged.
>>
>>
>>
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Dan Shafer, Revolution Consultant and Author
>> http://www.shafermedia.com Get my book, "Revolution: Software
>> at the Speed of Thought"
>>  From http://www.revolutionpros.com, Click "My Stuff"
>>
>>
>>
>> _______________________________________________
>> use-revolution mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage
>> your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>>
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Windows Command Help

Dan Shafer
In reply to this post by mwieder
Not on this end.

Well, I should say that I tried it directly in the shell, not from  
Rev. There, I typed:

start "blah\blah\doc.pdf"

It opened a new command line window and stared at me.

I'll try it tomorrow from inside Rev.

Dan

On Jul 28, 2005, at 7:51 PM, Mark Wieder wrote:

> get shell("start" && tPathToDocument) -- works for me
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Windows Command Help

Brian Yennie
Dan,

I'm all MacOS here, but I did notice a couple of things which might
help you-

1) You may need the drive name, i.e.:

start "c:\blah\blah\doc.pdf"

2) When inside Rev, you can use the hideConsoleWindows property to hide
the nasty window (or something close to that, don't have my reference
handy).

HTH

- Brian

> Not on this end.
>
> Well, I should say that I tried it directly in the shell, not from
> Rev. There, I typed:
>
> start "blah\blah\doc.pdf"
>
> It opened a new command line window and stared at me.
>
> I'll try it tomorrow from inside Rev.
>
> Dan
>
> On Jul 28, 2005, at 7:51 PM, Mark Wieder wrote:
>
>> get shell("start" && tPathToDocument) -- works for me
>>
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Windows Command Help

xbury.cs
In reply to this post by Dan Shafer
Dan

if you type

echo %ProgramFiles%
you will get the path by default were apps are installed

you can do a find using the F3 or WindowKey+F and search for acrobat...

if the exe is not in your paths then, there's no way windows will go
looking for it...

I just tried it
D:\NBU 5.0\Doc>start MediaMgr_AdminGuide_SSO.pdf
it works...

cheers
---------------------=---------------------
Xavier Bury
Clearstream Services
TNS NT LAN Server
ext 36465
Voice: +352 4656 43 6465
Fax: +352 4656 493 6465

[hidden email] wrote on 29/07/2005 07:03:22:

> Not on this end.
>
> Well, I should say that I tried it directly in the shell, not from
> Rev. There, I typed:
>
> start "blah\blah\doc.pdf"
>
> It opened a new command line window and stared at me.
>
> I'll try it tomorrow from inside Rev.
>
> Dan
>
> On Jul 28, 2005, at 7:51 PM, Mark Wieder wrote:
>
> > get shell("start" && tPathToDocument) -- works for me
> >
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution



-----------------------------------------
Visit us at http://www.clearstream.com
                                                         
IMPORTANT MESSAGE

Internet communications are not secure and therefore Clearstream
International does not accept legal responsibility for the contents of
this message.

The information contained in this e-mail is confidential and may be
legally privileged. It is intended solely for the addressee. If you are
not the intended recipient, any disclosure, copying, distribution or
any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful. Any views expressed in this e-mail are
those of the individual sender, except where the sender specifically
states them to be the views of Clearstream International or of any of
its affiliates or subsidiaries.

END OF DISCLAIMER
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Windows Command Help

Dan Shafer
Well, that's the secret, then.

Back to the drawing board. The shell solution is not acceptable. I am  
amazed (and shouldn't be) that a feature Mac OS has had for a long,  
long time is missing from the vastly more popular Windows OS.

Heh heh.

Dan

On Jul 28, 2005, at 11:17 PM, [hidden email] wrote:

> if the exe is not in your paths then, there's no way windows will go
> looking for it...
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Windows Command Help

mwieder
In reply to this post by Dan Shafer
Dan-

Thursday, July 28, 2005, 10:03:22 PM, you wrote:

DS> Well, I should say that I tried it directly in the shell, not from
DS> Rev. There, I typed:

DS> start "blah\blah\doc.pdf"

Make sure you use a fully-qualified path:

"drive:\root\subdirectory\etc\document.ext"

--
-Mark Wieder
 [hidden email]

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
--
 Mark Wieder
 ahsoftware@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Windows Command Help

Trevor DeVore
In reply to this post by Dan Shafer
On Jul 28, 2005, at 11:39 PM, Dan Shafer wrote:

> Well, that's the secret, then.
>
> Back to the drawing board. The shell solution is not acceptable. I  
> am amazed (and shouldn't be) that a feature Mac OS has had for a  
> long, long time is missing from the vastly more popular Windows OS.
>
> Heh heh.

Dan,

If you can't get anything else to work you could try the EnhancedWin  
dll I posted the other day.  In addition to some commands that allow  
you to limit your Windows apps to a single instance, there is also a  
command that I use as a replacement for revMail and revGoURL that  
should also work for files.  It is called ewinOpenURL.  Just pass the  
file path instead of a url.  So something like this should work:

ewinOpenURL "c:\Some Folder\My Doc.doc"

The command uses the ShellExecute API on Windows which opens the file  
in the default document whether it is a url or file.

You can download it here:
<http://www.mangomultimedia.com/download/revolution/enhancedwin/ 
EnhancedWin.zip>

There is a readme that explains how to use it.

--
Trevor DeVore
Blue Mango Multimedia
[hidden email]


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Windows Command Help

Jon-3
In reply to this post by Dan Shafer
Windows has a facility built in that associates file extensions with
applications.  Thus, you can tell Windows that the default application
for a JPG is FRED.EXE.  Normally, any useful document has an associated
application. There are ways to ask windows to open a document using the
default application. In Delphi, this is what I write to do this:

   i := ShellExecute(Application.handle, 'open', fName, '', '',
SW_SHOWNORMAL);

Now, how easy it might be to do this from within Rev, I cannot say. I'm
just explaining how Windows works.  Hope this helps.  Feel free to
contact me off list if you want to get into the details.

:)

Jon


Dan Shafer wrote:

> The problem is I don't know the name or path of the app. On OS X,  
> this doesn't matter. But it appears I cannot ask Windows to launch a  
> document and expect it to figure out which app to use.
>
> Great.
>
> Dan
>
> On Jul 28, 2005, at 6:24 PM, MisterX wrote:
>
>> Hi Dan
>>
>> It's funny to see MacOS - no-to-CLIs - crowd do it in Unix and not  
>> in DOS ;0
>>
>> what you need is something like
>> c:\notepad <pathtomyfile>
>> or notepad.exe <path to myfile"
>> or <pathtoapp> <path to file> should work...
>>
>> BUT this will block Rev... :(
>>
>> so shell("start" && quote && appspath && docpath && quote should  
>> work...)
>>
>> cheers
>> Xavier
>>
>>
>>> -----Original Message-----
>>> From: [hidden email]
>>> [mailto:[hidden email]] On Behalf Of
>>> Dan Shafer
>>> Sent: Friday, July 29, 2005 02:57
>>> To: Revolution List
>>> Subject: [OT] Windows Command Help
>>>
>>> In OS X, I can issue the shell command "launch" followed by a
>>> document path and the system opens that document with the
>>> appropriate app.
>>>
>>> Is there an equivalent command/syntax for Windows? I tried "start"
>>> but if I give it a document path, it opens a new command
>>> window but doesn't do anything.
>>>
>>> Thanks in advance for any help for the Windows-challenged.
>>>
>>>
>>>
>>>
>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> Dan Shafer, Revolution Consultant and Author
>>> http://www.shafermedia.com Get my book, "Revolution: Software
>>> at the Speed of Thought"
>>>  From http://www.revolutionpros.com, Click "My Stuff"
>>>
>>>
>>>
>>> _______________________________________________
>>> use-revolution mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage
>>> your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>>
>>>
>>
>> _______________________________________________
>> use-revolution mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Windows Command Help

Brian K. Maher
Hi Jon,

In Rev just use the shell.  The command would be "start you_file_name_goes_here".

Brian

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

RE: [OT] Windows Command Help

Lynch, Jonathan
In reply to this post by Dan Shafer
There are a number of nuances to this issue, depending on which windows
system you are using, etc...

I pieced together the following script from scripts that others created
for this purpose. (Just so no one thinks I am stealing someone else's
thunder.) It seems to work pretty well...

on launchdocument pWhich
  if there is not a file pWhich then exit launchdocument
  revSetWindowsShellCommand
  put revRunningWindowsNT() into tNT
  if the platform is "Win32" then
    replace "/" with "\" in pWhich
    --put "file:///" before pWhich
    set the itemdelimiter to "."
    put the last item of pWhich into tExtension
    put "HKEY_CLASSES_ROOT\." & tExtension & "\" into tQuery
    put queryRegistry(tQuery) into tApp
   
    PUT "HKEY_CLASSES_ROOT\" & tApp & "\shell\open\command\" into tQuery
    put queryRegistry(tQuery) into tAppCommand
    put word 1 of tAppCommand into tAppCommand
    replace quote with empty in tAppCommand
    if not tNT then
      get shell("start " & quote & tAppCommand & quote && quote & pWhich
& quote)
    else
      set the hideconsolewindows to false
      open process (tAppCommand && quote & pWhich & quote) for neither
    end if
    put the result into tResult
    --answer tResult
    if tResult = "not opened" then
      if tAppCommand = empty then
        answer "I'm sorry, but your computer does not have an
application associated with that file extension. Shall I attempt to open
it with your browswer?" with "yes" and "no"
        if it is "yes" then
          revgourl pWhich
        end if
      else
        get shell("start " & quote & tAppCommand & quote && quote &
pWhich & quote)
        if the result <> empty then
          answer "I'm afraid I was unable to open the document with the
associated application. Shall I attempt to open it with your browser
instead?" with "yes" and "no"
          if it is "yes" then
            revgourl pWhich
          end if
        end if
      end if
    end if
    --  else if the platform is "MacOS" then
    --    if "appleScript" is not in the alternateLanguages then
    --      return "Error: AppleScript not installed"
    --    end if
    --    do ("open location" && quote & pWhich & quote) as appleScript
    --  else
    --    if gREVWebBrowser is empty
    --    then launch "mozilla" && quote & pWhich & quote
    --    else launch gREVWebBrowser && quote & pWhich & quote
  end if
end launchdocument

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Brian K.
Maher
Sent: Friday, July 29, 2005 8:59 AM
To: How to use Revolution
Subject: Re: [OT] Windows Command Help

Hi Jon,

In Rev just use the shell.  The command would be "start
you_file_name_goes_here".

Brian

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

RE: [OT] Windows Command Help

xbury.cs
Jon

Nice and extensive! ;)

Here's the simple form i use in my file browser

    if the platform is "Win32" then
      put queryRegistry("HKEY_CLASSES_ROOT\."&ftype&"\") into thisappClass
      put
queryRegistry("HKEY_CLASSES_ROOT\"&thisappClass&"\shell\open\command\")
into thisapp
      delete word 2 of thisapp -- %1
      if thisapp is not empty then
        launch (quote & fld "path" && thisfile & quote) with thisapp
        get the result
      end if

cheers
---------------------=---------------------
Xavier Bury
Clearstream Services
TNS NT LAN Server
ext 36465
Voice: +352 4656 43 6465
Fax: +352 4656 493 6465

[hidden email] wrote on 29/07/2005 15:37:17:

> There are a number of nuances to this issue, depending on which windows
> system you are using, etc...
>
> I pieced together the following script from scripts that others created
> for this purpose. (Just so no one thinks I am stealing someone else's
> thunder.) It seems to work pretty well...
>
> on launchdocument pWhich
>   if there is not a file pWhich then exit launchdocument
>   revSetWindowsShellCommand
>   put revRunningWindowsNT() into tNT
>   if the platform is "Win32" then
>     replace "/" with "\" in pWhich
>     --put "file:///" before pWhich
>     set the itemdelimiter to "."
>     put the last item of pWhich into tExtension
>     put "HKEY_CLASSES_ROOT\." & tExtension & "\" into tQuery
>     put queryRegistry(tQuery) into tApp
>
>     PUT "HKEY_CLASSES_ROOT\" & tApp & "\shell\open\command\" into tQuery
>     put queryRegistry(tQuery) into tAppCommand
>     put word 1 of tAppCommand into tAppCommand
>     replace quote with empty in tAppCommand
>     if not tNT then
>       get shell("start " & quote & tAppCommand & quote && quote & pWhich
> & quote)
>     else
>       set the hideconsolewindows to false
>       open process (tAppCommand && quote & pWhich & quote) for neither
>     end if
>     put the result into tResult
>     --answer tResult
>     if tResult = "not opened" then
>       if tAppCommand = empty then
>         answer "I'm sorry, but your computer does not have an
> application associated with that file extension. Shall I attempt to open
> it with your browswer?" with "yes" and "no"
>         if it is "yes" then
>           revgourl pWhich
>         end if
>       else
>         get shell("start " & quote & tAppCommand & quote && quote &
> pWhich & quote)
>         if the result <> empty then
>           answer "I'm afraid I was unable to open the document with the
> associated application. Shall I attempt to open it with your browser
> instead?" with "yes" and "no"
>           if it is "yes" then
>             revgourl pWhich
>           end if
>         end if
>       end if
>     end if
>     --  else if the platform is "MacOS" then
>     --    if "appleScript" is not in the alternateLanguages then
>     --      return "Error: AppleScript not installed"
>     --    end if
>     --    do ("open location" && quote & pWhich & quote) as appleScript
>     --  else
>     --    if gREVWebBrowser is empty
>     --    then launch "mozilla" && quote & pWhich & quote
>     --    else launch gREVWebBrowser && quote & pWhich & quote
>   end if
> end launchdocument
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Brian K.
> Maher
> Sent: Friday, July 29, 2005 8:59 AM
> To: How to use Revolution
> Subject: Re: [OT] Windows Command Help
>
> Hi Jon,
>
> In Rev just use the shell.  The command would be "start
> you_file_name_goes_here".
>
> Brian
>



-----------------------------------------
Visit us at http://www.clearstream.com
                                                         
IMPORTANT MESSAGE

Internet communications are not secure and therefore Clearstream
International does not accept legal responsibility for the contents of
this message.

The information contained in this e-mail is confidential and may be
legally privileged. It is intended solely for the addressee. If you are
not the intended recipient, any disclosure, copying, distribution or
any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful. Any views expressed in this e-mail are
those of the individual sender, except where the sender specifically
states them to be the views of Clearstream International or of any of
its affiliates or subsidiaries.

END OF DISCLAIMER
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Windows Command Help

Chipp Walters
In reply to this post by Lynch, Jonathan
Jon,

Thanks so much for this! Just what I needed last night :-)

-Chipp
Chipp Walters, Altuit.com
Sent from my Sidekick
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution