mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 13:11:43 +00:00
- Make dp0 give the directory the batch was run from instead of the current directory.
svn path=/trunk/; revision=32074
This commit is contained in:
parent
cf39f6646d
commit
4e8df678d2
3 changed files with 5 additions and 4 deletions
|
@ -220,6 +220,7 @@ VOID ExitBatch (LPTSTR msg)
|
|||
BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param)
|
||||
{
|
||||
HANDLE hFile;
|
||||
LPTSTR tmp;
|
||||
SetLastError(0);
|
||||
hFile = CreateFile (fullname, GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE, NULL,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL |
|
||||
|
@ -269,6 +270,8 @@ BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param)
|
|||
}
|
||||
|
||||
bc->hBatchFile = hFile;
|
||||
tmp = _tcsrchr(fullname, '\\');
|
||||
_tcsncpy(bc->BatchFilePath, fullname, ((_tcslen(fullname) - _tcslen(tmp)) + 1));
|
||||
SetFilePointer (bc->hBatchFile, 0, NULL, FILE_BEGIN);
|
||||
bc->bEcho = bEcho; /* Preserve echo across batch calls */
|
||||
bc->shiftlevel = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue