2

When I try to acess a file with spaces and then give them arguments, it doesn't recognize the path. If I type following it works:

C:\Users\Valentino>cmd /C adb push "C:\Users\Valentino\Desktop\Test.dat" "/sdcard/"

[This works]

If I try following, doesn't:

C:\Users\Valentino>cmd /C "C:/Path With Spaces/adb" push "C:\Users\Valentino\Desktop\Test.dat" "/sdcard/"

[Here it says 'C:/Path' doesn't is a valid file]

Neither this:

C:\Users\Valentino>cmd /C "adb" push "C:\Users\Valentino\Desktop\Test.dat" "/sdcard/"

[Here it says that the syntax is incorrect]

How must the syntax be, in order to read that file with spaces and give them arguments?

EDIT: You can try this even if you haven't adb installed. You will se that it will always fail, even on a existing file

Fusseldieb
  • 1,324
  • 2
  • 19
  • 44
  • When dealing with paths in DOS, you need to use the back slash (\\), not the forward slash (/) - i.e., "C:\Path With Spaces\adb", **not** "C/Path With Spaces/adb". – Tim Oct 08 '15 at 05:55
  • @Tim It doesn't work. I just tried it. It says again 'C:/Path' is not a valid file' – Fusseldieb Oct 08 '15 at 05:58
  • "C:/Path" looks like you're still using a forward slash. You need to use a back slash for DOS paths - C/Path.... – Tim Oct 08 '15 at 06:01
  • @Tim I tried both... / and \ – Fusseldieb Oct 08 '15 at 06:02
  • 2
    Possible duplicate of [Spaces problem in CMD !](http://stackoverflow.com/questions/6376113/spaces-problem-in-cmd) – Harry Johnston Oct 08 '15 at 21:43

2 Answers2

2

For using cmd command you need to use "Your File Name" ..

Here is an example..

keytool -exportcert -alias "your name" -keystore C:\Users\Desktop\your.keystore | C:\openssl-0.9.8k_X64\bin\openssl sha1 -binary | C:\openssl-0.9.8k_X64\bin\openssl base64

Edited : You can use below command for path in cmd :

cd "Path With Spaces"

For more detail, Refer this link and accepted answer..!!

How to use spaces in CMD?

Hope It will help you.

Thanks..!!

Community
  • 1
  • 1
AndiGeeky
  • 11,266
  • 6
  • 50
  • 66
1

As explained here you can run cmd like one of this:

cmd /C ""C:/Path With Spaces/adb" push C:\Users\Valentino\Desktop\Test.da /sdcard/"

or

cmd /C ""C:/Path With Spaces/adb" "push" "C:\Users\Valentino\Desktop\Test.da" "/sdcard/""
Paul
  • 2,620
  • 2
  • 17
  • 27