Bug 41052 - Executing batch files with spaces in their names (on Windows)
Summary: Executing batch files with spaces in their names (on Windows)
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
3.4.3 release
Hardware: Other Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-20 13:27 UTC by Roland Baudin
Modified: 2012-08-31 10:05 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Test files (3.79 KB, application/zip)
2011-09-20 13:28 UTC, Roland Baudin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roland Baudin 2011-09-20 13:27:40 UTC
On Windows, the Shell() function does not function properly when executing batch files with spaces in their name and when performing file redirections. 

To reproduce :

Create an example.bat in C:\Dir with Spaces with these lines :
@echo off

C:\Test\helloworld.exe > c:\test\output.txt


where helloworld.exe is an executable in C:\Test that displays the string Hello World! to the standard output.

Then in LibreOffice, create the following macro :

Sub Test



' These ones don't work
Shell("C:\Dir with Spaces\example.bat", 4, "", True)

'Shell("C:\Dir%20with%20Spaces\example.bat", 4, "", True)

'Shell("file:///C:/Dir%20with%20Spaces/example.bat", 4, "", True)
'Shell("""C:\Dir with Spaces\example.bat""", 4, "", True)


' This one works	
'Shell("C:\Dir_with_Spaces\example.bat", 4, "", True)



End Sub


Executing the Test macro with any of the four first methods above always produce an empty c:\Temp\output.txt file (file is created but does not contain anything).
The last one works, when the batch file name does not contain any space.
Comment 1 Roland Baudin 2011-09-20 13:28:18 UTC
Created attachment 51419 [details]
Test files
Comment 2 Björn Michaelsen 2011-12-23 12:39:52 UTC
[This is an automated message.]
This bug was filed before the changes to Bugzilla on 2011-10-16. Thus it
started right out as NEW without ever being explicitly confirmed. The bug is
changed to state NEEDINFO for this reason. To move this bug from NEEDINFO back
to NEW please check if the bug still persists with the 3.5.0 beta1 or beta2 prereleases.
Details on how to test the 3.5.0 beta1 can be found at:
http://wiki.documentfoundation.org/QA/BugHunting_Session_3.5.0.-1

more detail on this bulk operation: http://nabble.documentfoundation.org/RFC-Operation-Spamzilla-tp3607474p3607474.html
Comment 3 Florian Reisinger 2012-08-14 14:00:04 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian
Comment 4 Florian Reisinger 2012-08-14 14:01:12 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian
Comment 5 Florian Reisinger 2012-08-14 14:05:56 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian
Comment 6 Florian Reisinger 2012-08-14 14:07:58 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian