1.

Solve : Bat file issue with spaces?

Answer»

Hi, I'm pretty new to batch files, so I may not be doing it perfectly right, but anyway, I have this:

@echo off
START /d "C:\Program Files (x86)\Samsung SSD Magician" Samsung Magician.exe

This doesn't launch the exe file, however, if I rename the file to SamsungMagigican.exe, and then remove the space in the filename above, it works fine.

However, I don't want to have to rename files just so they will run, is there a way to fix this, I've googled it, but it's just making me more confused.

Thanks for any help.I seem to have fixed it doing this..

@echo off
START "" /b "c:\Program Files (x86)\Samsung SSD Magician\Samsung Magician.exe"

Not totally sure about the /b and /d, but glad I can do it without faffing about splitting the path,
since I'm creating the bats with java, and launching with java.

Let me know if any thought(s).
Thanks
hello,
PLEASE i have a problem:
I need your help. I have a lot of files in directory c:\temp shown as below :

c:\temp\test1 fit.csv
c:\temp\test2 fit.csv

I want to rename all this files by cut 'blank space' in names. I want to get following results :

c:\temp\test1fit.csv
c:\temp\test2fit.csv

thank you in advance...start a new threadIt occurs to me that a short google will find a solution to this issue, too:

https://www.google.com.au/search?hl=en&q=rename+filenames+to+remove+spaces+windowsthank you...

please i have another problem:
i have one name es: pipo
i want to add one path to 'pipo'.

Es:
input value: pipo

path to add: "c:\user\potatoes"

OUTPUT: c:\user\potatoes\pipo.

thank you in advance...Create your own thread please, and EXPLAIN your TASK a little better too - it's unclear what you need to do.OK,i have wrote this:
@echo off
setlocal enabledelayedexpansion

set oldchar=A
set newchar=P

pushd c:\temp

for /f %%i in ('dir /b /a-d *.csv') do (
set string=%%i

set "newchar="directoryName"

for /f "tokens=*" %%* in ('
"powershell -c ""$ENV:string"".replace('%oldchar%','%newchar%')"
') do set result=%%*

rem echo %result%
ren %%i !result!
)

popd

but i want to replace es:
i have i directory with bon.csv
nu.csv
sou.csv

i want in output have: directory name +nameFile.csv
like this:

es: C:\user\bon.csv
C:\user\nu.csv
C:\user\sou.csv

I don't know how can i do it.Another deaf typist...@bertin

Create your own thread instead of hi-jacking someone elses.



Discussion

No Comment Found