Using ".bat" file to build driver

I hope to build driver only by double-clicking a “.bat” file to generate sys files,
without opening a console window to input build command manually.

How can I write the “.bat” script file?

thanks a lot!

On Thu, 24 Dec 2009 04:57:28 -0500 (EST)
xxxxx@hotmail.com wrote:

I hope to build driver only by double-clicking a “.bat” file to
generate sys files, without opening a console window to input build
command manually.

How can I write the “.bat” script file?

I use a batch script to build my driver - see makerelease.bat
in http://www.bluestop.org/viewvc/repos/sctpDrv/ for an example of how
it can be done.


Bruce Cran

thanks, I will study it.

thanks. I will study it.

Google for DDKBUILD.BAT


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
>I hope to build driver only by double-clicking a “.bat” file to generate sys files,
> without opening a console window to input build command manually.
>
> How can I write the “.bat” script file?
>
> thanks a lot!
>

the following script just complies WDK sample codes, why?

@echo off

@set PROJDIR=D:\sys

@if not exist “%WDKPATH%\bin\setenv.bat” set WDKPATH=C:\WinDDK\7600.16385.0

@echo on

cmd /c “%WDKPATH%\bin\setenv.bat %WDKPATH% fre x86 wxp && CD %PROJDIR% && build /ceZgw”

To do that you must have DDKBUILD from either OSROnline or Hollistech.com.
Then it’s a braindead:

“Ddkbuild -WIN7A64 checked .”

Oh … and bat is so dos … why not a CMD file?

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Thursday, December 24, 2009 3:57 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Using “.bat” file to build driver

I hope to build driver only by double-clicking a “.bat” file to generate sys
files,
without opening a console window to input build command manually.

How can I write the “.bat” script file?

thanks a lot!


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

__________ Information from ESET Smart Security, version of virus signature
database 4715 (20091224) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature
database 4715 (20091224) __________

The message was checked by ESET Smart Security.

http://www.eset.com

???

!!! and …

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Thursday, December 24, 2009 9:14 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Using “.bat” file to build driver

???


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

__________ Information from ESET Smart Security, version of virus signature
database 4715 (20091224) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature
database 4715 (20091224) __________

The message was checked by ESET Smart Security.

http://www.eset.com

On Thu, Dec 24, 2009 at 7:02 PM, wrote:

> cmd /c “%WDKPATH%\bin\setenv.bat %WDKPATH% fre x86 wxp && CD %PROJDIR% &&
> build /ceZgw”

Try this

cmd /c “%WDKPATH%\bin\setenv.bat %WDKPATH% fre x86 wxp && D: && CD %PROJDIR%
&& build /ceZgw”

“Wayne Gong” wrote in message news:xxxxx@ntdev…
> On Thu, Dec 24, 2009 at 7:02 PM, wrote:
>
>> cmd /c “%WDKPATH%\bin\setenv.bat %WDKPATH% fre x86 wxp && CD %PROJDIR% &&
>> build /ceZgw”
>
>
>
> Try this
>
> cmd /c “%WDKPATH%\bin\setenv.bat %WDKPATH% fre x86 wxp && D: && CD
> %PROJDIR%
> && build /ceZgw”
>

Nope. cd /d %PROJDIR% will work. (note /d )

–pa

You wrote:

To do that you must have DDKBUILD from either OSROnline or Hollistech.com.
Then it’s a braindead:

“Ddkbuild -WIN7A64 checked .”

Oh … and bat is so dos … why not a CMD file?

You do realize there is absolutely no difference between the two, right? It’s just two names for the same thing.

Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

On Thu, Dec 24, 2009 at 06:02:16AM -0500, xxxxx@hotmail.com wrote:

the following script just complies WDK sample codes, why?

@echo off
@set PROJDIR=D:\sys
@if not exist “%WDKPATH%\bin\setenv.bat” set WDKPATH=C:\WinDDK\7600.16385.0
@echo on
cmd /c “%WDKPATH%\bin\setenv.bat %WDKPATH% fre x86 wxp && CD %PROJDIR% && build /ceZgw”

Because the “setenv” script changes the current directory to your WDK path,
so that’s where “build” executes. You need to do a pushd/popd around the
call to setenv so you end up where you started.

By the way, you don’t need the “@” prefix once you have turned “echo off”.
The effect of “@” is to suppress the echo. You only need one or the other.

Tim Roberts, xxxxx@probo.com
Providenza & Boeklheide, Inc.

Yourrrrright laddie. Running DDKBUILD from Powershell would be even better
:slight_smile:

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Saturday, December 26, 2009 4:11 PM
To: Windows System Software Devs Interest List
Subject: Re: RE: [ntdev] Using “.bat” file to build driver

You wrote:

To do that you must have DDKBUILD from either OSROnline or Hollistech.com.
Then it’s a braindead:

“Ddkbuild -WIN7A64 checked .”

Oh … and bat is so dos … why not a CMD file?

You do realize there is absolutely no difference between the two, right?
It’s just two names for the same thing.

Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

__________ Information from ESET Smart Security, version of virus signature
database 4717 (20091226) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature
database 4717 (20091226) __________

The message was checked by ESET Smart Security.

http://www.eset.com

“Gary G. Little” wrote in message
news:xxxxx@ntdev…
> Yourrrrright laddie. Running DDKBUILD from Powershell would be even better
> … :slight_smile:

The best would be if the whole WDK build process would be PowerShell based,
or if there would be an official supported way of doing everything in a
PowerShell window.


Aram Hăvărneanu

Currently, there is nothing to stop you from opening a WDK BUILD environment and then launching Powershell. That will give you a WDK friendly Powershell commanline environment.

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Aram Havarneanu
Sent: Sunday, December 27, 2009 6:05 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] RE: Using “.bat” file to build driver

“Gary G. Little” wrote in message
news:xxxxx@ntdev…
> Yourrrrright laddie. Running DDKBUILD from Powershell would be even better
> … :slight_smile:

The best would be if the whole WDK build process would be PowerShell based,
or if there would be an official supported way of doing everything in a
PowerShell window.


Aram Hăvărneanu


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Information from ESET Smart Security, version of virus signature database 4720 (20091227)

The message was checked by ESET Smart Security.

http://www.eset.com

Information from ESET Smart Security, version of virus signature database 4720 (20091227)

The message was checked by ESET Smart Security.

http://www.eset.com

Not to be too pedantic, but on CMDs found in Windows 200 and XP, *.bat
defaults to the extensions off, while *.cmd defaults to extensions on. At
least, they did that the last time I looked. Not sure about Vista or
Windows 7. At one time, at least, there was a difference. Not entirely
sure if it still exists.

Phil

Philip D. Barila (303) 776-1264

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Saturday, December 26, 2009 3:11 PM
To: Windows System Software Devs Interest List
Subject: Re: RE: [ntdev] Using “.bat” file to build driver

You wrote:

To do that you must have DDKBUILD from either OSROnline or Hollistech.com.
Then it’s a braindead:

“Ddkbuild -WIN7A64 checked .”

Oh … and bat is so dos … why not a CMD file?

You do realize there is absolutely no difference between the two, right?
It’s just two names for the same thing.

Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

On Sun, Dec 27, 2009 at 04:18:11PM -0700, Philip D Barila wrote:

Not to be too pedantic, but on CMDs found in Windows 200 and XP, *.bat
defaults to the extensions off, while *.cmd defaults to extensions on. At
least, they did that the last time I looked. Not sure about Vista or
Windows 7. At one time, at least, there was a difference. Not entirely
sure if it still exists.

This is certainly not the case now, and I’m not convinced it ever was. NT
has had the .cmd and .bat file extensions since the very beginning, but
the shell command extensions didn’t come into being until NT 4.0.

It’s possible that .bat was originally mapped to command.com (which still
exists) while cmd was mapped to cmd.exe, but even that hasn’t been true
since NT 4.0.

Tim Roberts, xxxxx@probo.com
Providenza & Boeklheide, Inc.

thanks everyone.

Wayne Gong and Pavel A,
The script works now.
thanks a lot!! :slight_smile:

msft, in my opinion of course, should draw a line and replace cmd.exe
with powershell and be done with the whole sorry excuse of a command
line shell that dos era nonsense represents. That and short names.
And get rid of spaces and parenthesis in pathnames.
And forget about ETW
And cough up the source code for KMDF.
And …

On the other hand the bing app on my iphone is most excellent.

Happy Holidays
Mark Roddy

On Sun, Dec 27, 2009 at 11:43 PM, wrote:
> On Sun, Dec 27, 2009 at 04:18:11PM -0700, Philip D Barila wrote:
>>
>> Not to be too pedantic, but on CMDs found in Windows 200 and XP, *.bat
>> defaults to the extensions off, while *.cmd defaults to extensions on. ?At
>> least, they did that the last time I looked. ?Not sure about Vista or
>> Windows 7. ?At one time, at least, there was a difference. ?Not entirely
>> sure if it still exists.
>
> This is certainly not the case now, and I’m not convinced it ever was. ?NT
> has had the .cmd and .bat file extensions since the very beginning, but
> the shell command extensions didn’t come into being until NT 4.0.
>
> It’s possible that .bat was originally mapped to command.com (which still
> exists) while cmd was mapped to cmd.exe, but even that hasn’t been true
> since NT 4.0.
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boeklheide, Inc.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>