Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write a full path in a batch file having a folder name with space?

Tags:

batch-file

I am writing following command in batch file

REGSVR32 E:\Documents and Settings\All Users\Application Data\xyz.dll 

After running this command I am getting following error

LodLibrary(e:\Documents) failed specified module could not be found. 

How can I fix this problem?

like image 640
Hemant Kothiyal Avatar asked Sep 08 '11 11:09

Hemant Kothiyal


People also ask

How do you write the path of a folder with space in its name?

Use quotation marks when specifying long filenames or paths with spaces. For example, typing the copy c:\my file name d:\my new file name command at the command prompt results in the following error message: The system cannot find the file specified.

How do you add a space in a batch file?

To create a blank line in a batch file, add an open bracket or period immediately after the echo command with no space, as shown below. Adding @echo off at the beginning of the batch file turns off the echo and does not show each of the commands.

How do I get the path of a batch file?

Try CD C:\Temp <CR> ECHO %CD% ( <CR> is newline...) Also, if you right-click on the script and select "Run as Administrator", the starting current directory is C:\Windows\System32 regardless of where the script is located.


2 Answers

CD E:\Documents and Settings\All Users\Application Data

E:\Documents and Settings\All Users\Application Data>REGSVR32 xyz.dll

like image 28
Brian Baylis Avatar answered Sep 22 '22 06:09

Brian Baylis


Put double quotes around the path that has spaces like this:

REGSVR32 "E:\Documents and Settings\All Users\Application Data\xyz.dll"

like image 144
Bali C Avatar answered Sep 22 '22 06:09

Bali C