Sign in with
Sign up | Sign in
Your question

Syntax for Command Line with Spaces

Tags:
  • Filename
  • Microsoft
  • Command Line
  • Windows XP
Last response: in Windows XP
Share
September 7, 2005 12:44:32 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

I need help writing a command line.

I need to pass a filename as an argument to an executable file. The
filename may have a space in it, and the executable filename has a
space in it. For instance:

"Executable File.exe" "C:\Argument File.mde"

But that doesn't work. What is the proper syntax?


-TC

More about : syntax command line spaces

September 7, 2005 1:08:57 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

Torgeir: Perhaps I simplified too much when trying to create a generic
example. The exact command line I'm trying to use is

"Access App Starter.exe" /ApplicationFile "C:\Program Files\Veeco
Probes Product App\Veeco Probes Product App.mde"


Dave: I don't understand your question "Why does a response file NEED a
space in it?" These files have spaces in them. I don't know if they
need them, but they have them, and I must write a command line which
uses them as they are.


-TC
September 7, 2005 1:29:17 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

Torgeir,

I am executing the command from the folder which contains "Access App
Starter.exe". The error is:

'Access' is not recognized as an internal or external command, operable
program or batch file.


-TC
Related resources
September 7, 2005 2:27:45 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

Torgeir,

I have discovered that the following command works:

"Access App Starter.exe" /ApplicationFile 'C:\Program Files\Veeco
Probes Product App\Veeco Probes Product App.mde'

>From this exercise, I have inferred that parameters passed in a command
line may not use double quotes, but may use single quotes. The
restriction seems to apply to commands typed directly on the command
line or executed from a Windows Installer Shortcut, but do not apply to
commands executed from .bat files or .lnk shortcuts. (In other words,
the exact same command may work in a batch file and fail when typed
directly.) Can anyone confirm this observation?

-TC
Anonymous
September 7, 2005 3:50:59 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

From: "TC" <golemdanube@yahoo.com>

| I need help writing a command line.
|
| I need to pass a filename as an argument to an executable file. The
| filename may have a space in it, and the executable filename has a
| space in it. For instance:
|
| "Executable File.exe" "C:\Argument File.mde"
|
| But that doesn't work. What is the proper syntax?
|
| -TC

That should work or just use the 8.3 name instead.
The question is why does a response file NEED a space in it ?

--
Dave
http://www.claymania.com/removal-trojan-adware.html
http://www.ik-cs.com/got-a-virus.htm
Anonymous
September 7, 2005 4:35:11 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

From: "TC" <golemdanube@yahoo.com>

| Torgeir: Perhaps I simplified too much when trying to create a generic
| example. The exact command line I'm trying to use is
|
| "Access App Starter.exe" /ApplicationFile "C:\Program Files\Veeco
| Probes Product App\Veeco Probes Product App.mde"
|
| Dave: I don't understand your question "Why does a response file NEED a
| space in it?" These files have spaces in them. I don't know if they
| need them, but they have them, and I must write a command line which
| uses them as they are.
|
| -TC

TC:

A simple workaround would be to script the following...

Run_Acces_App.cmd
------------------------
@echo off
c:
cd "C:\Program Files\Veeco Probes Product App"
copy "Veeco Probes Product App.mde" response.mde
"Access App Starter.exe" /ApplicationFile response.mde

--
Dave
http://www.claymania.com/removal-trojan-adware.html
http://www.ik-cs.com/got-a-virus.htm
Anonymous
September 7, 2005 4:40:20 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

"TC" <golemdanube@yahoo.com> wrote:

>I need help writing a command line.
>
>I need to pass a filename as an argument to an executable file. The
>filename may have a space in it, and the executable filename has a
>space in it. For instance:
>
> "Executable File.exe" "C:\Argument File.mde"
>
>But that doesn't work. What is the proper syntax?

Looks like it should work. Maybe you need to add the path to the
executable file name, something like:

"c:\program files\some dir\Executable File.exe" "C:\Argument File.mde"

--
Tim Slattery
MS MVP(DTS)
Slattery_T@bls.gov
Anonymous
September 7, 2005 9:58:40 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

TC wrote:

> I need help writing a command line.
>
> I need to pass a filename as an argument to an executable file. The
> filename may have a space in it, and the executable filename has a
> space in it. For instance:
>
> "Executable File.exe" "C:\Argument File.mde"
>
> But that doesn't work. What is the proper syntax?
>
Hi,

The syntax above is correct.

Please post the exact command line you are trying to use.



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
Anonymous
September 7, 2005 10:17:19 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

TC wrote:

> Torgeir: Perhaps I simplified too much when trying to create a generic
> example. The exact command line I'm trying to use is
>
> "Access App Starter.exe" /ApplicationFile "C:\Program Files\Veeco
> Probes Product App\Veeco Probes Product App.mde"
>
Hi,

The syntax above is fine.

1)
What exact error message do you get?

2)
Is "Access App Starter.exe" located in a folder that is included
in the PATH environment variable, or are the folder where the exe
is located your current folder when launching it, or are "Access
App Starter.exe" added to "App Paths" in registry?



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
Anonymous
September 7, 2005 10:40:00 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

TC wrote:

> Torgeir,
>
> I am executing the command from the folder which contains "Access App
> Starter.exe". The error is:
>
> 'Access' is not recognized as an internal or external command, operable
> program or batch file.
>
Hi,

That is what you would get if you had run this command without quotes
around it:

Access App Starter.exe


But it should not happen if you really use quotes around it:

"Access App Starter.exe"


unless "Access App Starter.exe" try to launch Access.exe in a
"bad" way.



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
!