Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Start /wait fails to start commands with spaces

Featured Replies

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.

This works for me

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

Saw few times this strange behavior - try this command:

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

Is it working now?

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

Thats true - everything defined in

HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths can be run without path. Or of course everything in Path variable...

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.

  • Author

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

Thanks again :lol:

  • Author

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

2clavicle: I see your problem - it is taking strings between "" characters as Title - so the second "" is the command to execute.

  • Author

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

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?

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

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.