Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
a127ad1c
Commit
a127ad1c
authored
Mar 25, 2003
by
Stefan Leichter
Committed by
Alexandre Julliard
Mar 25, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let wcmd handle .cmd files like .bat files.
parent
c9fda6fa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
shlexec.c
dlls/shell32/shlexec.c
+1
-1
batch.c
programs/wcmd/batch.c
+9
-2
wcmdmain.c
programs/wcmd/wcmdmain.c
+8
-1
No files found.
dlls/shell32/shlexec.c
View file @
a127ad1c
...
@@ -264,7 +264,7 @@ static UINT SHELL_FindExecutable(LPCSTR lpPath, LPCSTR lpFile, LPCSTR lpOperatio
...
@@ -264,7 +264,7 @@ static UINT SHELL_FindExecutable(LPCSTR lpPath, LPCSTR lpFile, LPCSTR lpOperatio
/* See if it's a program - if GetProfileString fails, we skip this
/* See if it's a program - if GetProfileString fails, we skip this
* section. Actually, if GetProfileString fails, we've probably
* section. Actually, if GetProfileString fails, we've probably
* got a lot more to worry about than running a program... */
* got a lot more to worry about than running a program... */
if
(
GetProfileStringA
(
"windows"
,
"programs"
,
"exe pif bat com"
,
if
(
GetProfileStringA
(
"windows"
,
"programs"
,
"exe pif bat c
md c
om"
,
buffer
,
sizeof
(
buffer
))
>
0
)
buffer
,
sizeof
(
buffer
))
>
0
)
{
{
UINT
i
;
UINT
i
;
...
...
programs/wcmd/batch.c
View file @
a127ad1c
...
@@ -47,15 +47,22 @@ extern DWORD errorlevel;
...
@@ -47,15 +47,22 @@ extern DWORD errorlevel;
void
WCMD_batch
(
char
*
file
,
char
*
command
,
int
called
)
{
void
WCMD_batch
(
char
*
file
,
char
*
command
,
int
called
)
{
HANDLE
h
;
#define WCMD_BATCH_EXT_SIZE 5
HANDLE
h
=
INVALID_HANDLE_VALUE
;
char
string
[
MAXSTRING
];
char
string
[
MAXSTRING
];
char
extension
[][
WCMD_BATCH_EXT_SIZE
]
=
{
".bat"
,
".cmd"
};
int
i
;
BATCH_CONTEXT
*
prev_context
;
BATCH_CONTEXT
*
prev_context
;
for
(
i
=
0
;
(
i
<
(
sizeof
(
extension
)
/
WCMD_BATCH_EXT_SIZE
))
&&
(
h
==
INVALID_HANDLE_VALUE
);
i
++
)
{
strcpy
(
string
,
file
);
strcpy
(
string
,
file
);
CharLower
(
string
);
CharLower
(
string
);
if
(
strstr
(
string
,
".bat"
)
==
NULL
)
strcat
(
string
,
".bat"
);
if
(
strstr
(
string
,
extension
[
i
])
==
NULL
)
strcat
(
string
,
extension
[
i
]
);
h
=
CreateFile
(
string
,
GENERIC_READ
,
FILE_SHARE_READ
,
h
=
CreateFile
(
string
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
}
if
(
h
==
INVALID_HANDLE_VALUE
)
{
if
(
h
==
INVALID_HANDLE_VALUE
)
{
SetLastError
(
ERROR_FILE_NOT_FOUND
);
SetLastError
(
ERROR_FILE_NOT_FOUND
);
WCMD_print_error
();
WCMD_print_error
();
...
...
programs/wcmd/wcmdmain.c
View file @
a127ad1c
...
@@ -366,9 +366,16 @@ char filetorun[MAX_PATH];
...
@@ -366,9 +366,16 @@ char filetorun[MAX_PATH];
return
;
return
;
}
}
}
}
if
((
strchr
(
param1
,
'.'
)
==
NULL
)
||
(
strstr
(
param1
,
".cmd"
)
!=
NULL
))
{
if
(
SearchPath
(
NULL
,
param1
,
".cmd"
,
sizeof
(
filetorun
),
filetorun
,
NULL
))
{
WCMD_batch
(
filetorun
,
command
,
0
);
return
;
}
}
}
}
else
{
/* Explicit path given */
else
{
/* Explicit path given */
if
(
strstr
(
param1
,
".bat"
)
!=
NULL
)
{
if
((
strstr
(
param1
,
".bat"
)
!=
NULL
)
||
(
strstr
(
param1
,
".cmd"
)
!=
NULL
))
{
WCMD_batch
(
param1
,
command
,
0
);
WCMD_batch
(
param1
,
command
,
0
);
return
;
return
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment