Shell command syntax in Windows
bonnmike at gmail.com
Wed Jun 25 02:19:43 CEST 2014
Easiest way to do it with shell is with the absolute path. Or you could cd
to the location, and use a semicolon to string two commands like so:
put shell(merge("cd [[path]] ; dir")) into field one -- changes directory,
then gets the dir.
Or this with an absolute path.
put the shortfilepath of "c:\whatever path\you need\" into tPath --
shortfilepath so you don't have to worry about escaping spaces. Turns it
into an 8.3 path.
put shell(merge("dir [[tPath]]")) into field one -- single shell command
rather than 2 strung together with semicolon
The shellcommand isn't used to set the path, it should point to the shell
you wish to use for the command execution. (not on my windows machine, so
can't tell you where cmd is) Shouldn't be needed in this case though.
On Tue, Jun 24, 2014 at 4:59 PM, Mark Wieder <mwieder at ahsoftware.net> wrote:
> Monday, June 23, 2014, 7:45:52 PM, you wrote:
> > I m trying to run a shell command on Windows and the following
> > code gives an error on the put the wheel of dir into field one .
> > The goal of the script below is to get a directory listing in the
> Programs folder.
> > Setup: A field one and a button where this script is in.
> > on mouseUp
> > set the shellCommand to C:\ProgramData\Microsoft\Start Menu\Programs
> > put shell ( dir ) into field one
> > end mouseUp
> Been a while since I've had to deal with Windows, but I believe the
> shellCommand has to point to either command.com or cmd.exe, depending
> on the Windows version.
> If you want to get a directory listing of the Programs folder, why not
> set the defaultFolder and get the files?
> -Mark Wieder
> ahsoftware at gmail.com
> This communication may be unlawfully collected and stored by the National
> Security Agency (NSA) in secret. The parties to this email do not
> consent to the retrieving or storing of this communication and any
> related metadata, as well as printing, copying, re-transmitting,
> disseminating, or otherwise using it. If you believe you have received
> this communication in error, please delete it immediately.
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
More information about the use-livecode