Jump to content

Start /wait fails to start commands with spaces


Recommended Posts

Posted

I have got this weird problem lately that I am unable to execute the batch file commands which have spaces in them. e.g.

start /wait "c:\program files\Office\winword.exe"

or

start /wait "c:\my documents\my document with spaces.doc"

In both cases either a new window is opened or the error message "cannot find c:\program" is shown! :no:

Any guess? Or may be I have screwed up some registry setting.

My pc uses NTFS, RAID0, nlited Windows XP Pro.


Posted

This works for me

Path="C:\Program Files\Microsoft Office\Office10"
Start /Wait WINWORD.EXE

Posted

You could leave the 'title' blank too and because 'Word' will already be in your path, also there should be no need for the extension because Windows will look for .exe anyhow

start "" /w winword

Posted

I had exactly the same problem with that. Use "%ProgramFiles%\Office\winword.exe" and "%UserProfile%\My Documents\my document with spaces.doc" and it should work.

Posted

Thanks all you guys, tried soulin's and Yzöwl's methods and they work just fine and relieved I am!

Thanks again :lol:

Posted

@Marthax, using absolute paths like %programfiles% etc. doesn't help, you really have to put in quotes after /wait.

Posted

Yes soulin!, your point is well taken and I have no problems now. All the batch files are working well. Thanks!

Posted

What would I had to write, if I have a command with spaces within an option, like

del "c:\documents and settings\user\desktop\*" /Q /F

?

It seems, that the start /wait command doesn't like these addiotional quotas.

I tried this

start "" /wait "del "c:\documents and settings\user\desktop\*" /Q /F"

How do I get this to run?

Posted
What would I had to write, if I have a command with spaces within an option, like

del "c:\documents and settings\user\desktop\*"  /Q /F

?

It seems, that the start /wait command doesn't like these addiotional quotas.

I tried this

start "" /wait "del "c:\documents and settings\user\desktop\*" /Q /F"

How do I get this to run?

Spaces are not the issue. Type Start /? at the prompt to see the syntax.

del is an internal command, so it will be the same as calling cmd with a /k switch. I am not sure you want this?

Using Delete directly

Del /f /q "c:\documents and settings\user\desktop\*"

Or with Start. (same as cmd /k, so window stays open)

Start "Title" Del /q /f "c:\documents and settings\user\desktop\*"

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...