### Usage Example Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/security/x509 certificate enrollment/vc/enrollCustomPKCS10/Readme.txt This is an example of how to run the enrollCustomPKCS10 executable with the required arguments. ```text enrollCustomPKCS10 "CN=foo,OU=bar,DC=com" User@Domain.com 1.3.6.1.5.5.7.3.2 ``` -------------------------------- ### Display Help for Installer Options Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/sysmgmt/msi/setup.exe/readme.htm Use the /help option to display help on all available options for the Windows Installer. ```bash /help ``` -------------------------------- ### Subscription.EXE Usage Examples Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/sysmgmt/events/wec/cpp/Readme.txt These examples demonstrate various command-line operations for managing subscriptions, such as creating, deleting, enumerating, getting status, and retrieving properties. Some operations require administrator privileges. ```bash subscription.exe /cs MyTestSubscription ``` ```bash subscription.exe /ds MyTestSubscription ``` ```bash subscription.exe /es ``` ```bash subscription.exe /gr MyTestSubscription ``` ```bash subscription.exe /gs MyTestSubscription ``` ```bash subscription.exe /rs MyTestSubscription ``` ```bash subscription.exe /? ``` -------------------------------- ### Command Line Usage Examples Source: https://context7.com/microsoft/windows-classic-samples/llms.txt Provides examples of how to run the desktop duplication application from the command line with different options. ```text // Command line usage: // desktopduplication.exe /bitmap 5 - Save bitmap every 5 seconds // desktopduplication.exe /output all - Duplicate to all outputs ``` -------------------------------- ### Async Sample POST Example Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/web/Wininet/Async/Readme.txt Example of how to post the content of a file to a web server using the async sample application. ```text async -a post -h www.foo.com -o bar.asp -r postcontent.txt ``` -------------------------------- ### Get Profile GUID using IScanProfile Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/multimedia/wia/scanprofile/ReadMe.txt Obtain the unique GUID identifier for a scan profile by calling IScanProfile::GetGUID. This GUID is essential for referencing specific profiles. ```cpp hr = pScanProfile->GetGUID( &guidProfile ); ``` -------------------------------- ### Example Resource Values for Setup.exe Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/sysmgmt/msi/setup.exe/readme.htm Illustrates how to set ISETUPPROPNAME_BASEURL and ISETUPPROPNAME_DATABASE for different package locations. The trailing forward slash on the URL is optional. ```plaintext ISETUPPROPNAME_BASEURL = http://www.example.com/Products/Product1 ISETUPPROPNAME_DATABASE = product1.msi ``` ```plaintext ISETUPPROPNAME_BASEURL = http://www.example.com/Products/Product1 ISETUPPROPNAME_DATABASE = ../Product1/product1.msi ``` ```plaintext Omit ISETUPPROPNAME_BASEURL. ISETUPPROPNAME_DATABASE = product1.msi ``` ```plaintext Omit ISETUPPROPNAME_BASEURL. ISETUPPROPNAME_DATABASE = Setup\product1.msi ``` -------------------------------- ### Build Instructions for Subscription.EXE Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/sysmgmt/events/wec/cpp/Readme.txt Use 'nmake' to build the sample. Run 'nmake clean' followed by 'nmake' for a clean build. ```makefile nmake ``` ```makefile nmake clean nmake ``` -------------------------------- ### Start Tracing to File Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/winbase/Eventing/Controller/readme.txt Starts a tracing session to a specified log file. Replace with the desired session name and with the provider GUIDs. ```bash tracelog -start -guid -f ``` -------------------------------- ### Retrieve Domain Object Attributes Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/netds/adsi/devguide/adadsi.htm After binding to a domain object, you can retrieve its attributes using the Get method. This example shows how to get the 'Name' and 'whenCreated' attributes. ```vbscript Debug.Print dom.Get("Name") Debug.Print dom.Get("whenCreated") ``` -------------------------------- ### Setup.exe Command Line Parameters Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/sysmgmt/msi/setup.exe/readme.htm This section lists the command-line options that can be used with Setup.exe. ```APIDOC ## Setup.exe Command Line Parameters ### Description When invoked without any command line options, Setup.exe defaults to the behavior specified via the configured resources. The command line options are mutually exclusive; only one can be used at a time. ### Options - **_/a_** - **Usage:** `setup.exe /a` - **Meaning:** [Meaning not fully specified in the provided text, but implies an administrative installation or similar action.] ``` -------------------------------- ### Start ETW Logging Session Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/winbase/Eventing/Provider/Advanced/CPP/ReadMe.txt Start an ETW logging session for the AdvancedProvider using the 'logman.exe' tool. This command specifies the provider name, GUID, and output file for the trace. ```shell logman start -ets AdvancedProvider -p "Microsoft-Windows-SDKSample-AdvancedProvider" 0 0 -o AdvancedProvider.etl ``` -------------------------------- ### Build Sample with Visual Studio Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/winui/shell/appshellintegration/CreateProcessVerb/readme.txt Instructions for building the sample project using Visual Studio. ```bash 1. Open Windows Explorer and navigate to the CreateProcessVerb directory. 2. Double-click the icon for the CreateProcessVerb.sln file to open the file in Visual Studio. 3. In the Build menu, select Build Solution. The application will be built in the default \Debug or \Release directory. ``` -------------------------------- ### Install ETW Provider using wevtutil.exe Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/winbase/Eventing/Provider/Simple/CSharp/ReadMe.txt This command installs the ETW provider by registering its manifest file with the Windows Event Log system. This step is necessary before you can start logging events from the provider. ```batch wevtutil im SimpleProvider.man ``` -------------------------------- ### Build Sample with Command Prompt Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/winui/shell/appshellintegration/CreateProcessVerb/readme.txt Instructions for building the sample project using the command prompt and msbuild. ```bash 1. Open the Command Prompt window and navigate to the CreateProcessVerb directory. 2. Type msbuild CreateProcessVerb.sln. ``` -------------------------------- ### Build Sample with Command Prompt Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/dataaccess/OPC/musicbundlesignature/readme.txt Navigate to the project directory and use msbuild to build the sample. Ensure Visual Studio is installed. ```bash msbuild MusicBundleSignature.vcproj ``` -------------------------------- ### Example Output of User Creation from File Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/netds/adsi/activedir/createuser/vc/readme.txt This output details the attributes applied to the user from the specified file, followed by the standard properties of the newly created user object. The GUID will differ from previous examples. ```text attrib:objectClass value:User attrib:sAMAccountName value:TestU attrib:LogonHours value:x00 x00 x00 x00 xe0 xff x03 xe0 xff x03 xe0 xff x03 xe0 xff x03 xe0 xff x03 x00 x00 attrib:accountExpires value:125938656000000000 attrib:assistant value:CN=A Helper,CN=Users,DC=Fabrikam,DC=Com attrib:description value:This is a user created from a file.. New User created with the following properties: NAME: CN=Test User CLASS: User GUID: 14d5f80b623b1549877ba720a1877767 ADSPATH: LDAP://CN=Test User,OU=Example Org Unit,DC=Fabrikam,DC=Com PARENT: LDAP://OU=Example Org Unit,DC=Fabrikam,DC=Com SCHEMA: LDAP://schema/User ``` -------------------------------- ### Build Sample with Visual Studio Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/winbase/FSRM/SampleIFilterBasedClassifier/CPP/ContentBasedClassificationModule/ReadMe.txt Open the solution file in Visual Studio and select 'Build Solution' from the Build menu. ```batch Double-click the icon for the ContentBasedClassificationModule.sln (solution) file to open the file in Visual Studio. In the Build menu, select Build Solution. ``` -------------------------------- ### Get Windows Media Player Version Info Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/multimedia/WMP/webpages/detection/NS71obj.htm Retrieves the version information of the installed Windows Media Player. This is useful for compatibility checks or feature enablement. ```javascript WMPVer=MediaPlayer.versionInfo; ``` -------------------------------- ### Example Output of User Creation Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/netds/adsi/activedir/createuser/vc/readme.txt This is the typical output when a new user is successfully created, listing key properties of the user object in Active Directory. The GUID will vary with each execution. ```text New User created with the following properties: NAME: CN=Test User CLASS: User GUID: 70da5316cb6ee74ea7f05bb413753d21 (this value differs in each run) ADSPATH: LDAP://CN=Test User,OU=Example Org Unit,DC=Fabrikam,DC=Com PARENT: LDAP://OU=Example Org Unit,DC=Fabrikam,DC=Com SCHEMA: LDAP://schema/User ``` -------------------------------- ### Sample Provider Configuration File Example Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/WindowsDeploymentServices/SampleProvider/cpp/README.txt This is an example of the .ini configuration file used by the sample provider. It specifies default and device-specific boot programs and BCD files. The file must be named the same as the DLL, with a .ini extension, and placed in the same directory. ```ini [Configuration] DefaultBootProgram=boot\x86\pxeboot.com DefaultBcdFile=boot\my.bcd [Devices] 00000000000000000000FFEEDDCCBBAA=boot\x86\pxeboot.n12 ABCDEF0123456789ABCDEF0123456789=boot\x86\abortpxe.com 00000000000000000000AABBCCDDEEFF=boot\x64\pxeboot.n12 [BCDFiles] 00000000000000000000FFEEDDCCBBAA=boot\x86\my.bcd 00000000000000000000AABBCCDDEEFF=boot\x64\my.bcd ``` -------------------------------- ### Detect Windows Media Player Version Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/multimedia/WMP/webpages/detection/IEWMP64.htm Use this JavaScript code to determine the major version of Windows Media Player installed. It calls a function to get the version and assigns it to a variable. ```javascript WMPVer="6.4";AddDownloadLink(GetPlayerMajorVer()); ``` -------------------------------- ### Install Sample Script Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/winbase/FSRM/SampleIFilterBasedClassifier/CPP/ContentBasedClassificationModule/ReadMe.txt This script installs the binaries, registers the DLL with the system, registers with COM+, and registers the classifier with the FSRM pipeline. It may require editing if classifier or hosting model changes are needed. ```batch regsvr32 /s ContentBasedClassificationModule.dll register_app registers with COM+ registerwithfsrm registers this classifier with the FSRM pipeline ``` -------------------------------- ### Get Map and Listen for Reports Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/winui/Location/LocateMe.gadget/LocateMe.htm Retrieves the map object, checks report status, requests permissions if needed, and starts listening for location reports. Handles potential errors during initialization. ```javascript function GetMap() { var reportStatus = 0; try { reportStatus = LatLongFactory.Status; if (reportStatus == 2) { LatLongFactory.RequestPermissions(0); } map = new VEMap('myMap'); ReloadMap(); ListenForReports(); } catch( err ) { //Do nothing } } ``` ```javascript function ListenForReports() { LatLongFactory.ListenForReports(0); } ``` -------------------------------- ### Retrieve and Modify User Full Name Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/netds/adsi/devguide/nwcompat.htm Get an existing user object and modify its 'FullName' attribute. Ensure to call SetInfo to persist the changes. The example also shows how to print the updated FullName. ```vbscript objPath = "alicew,user" adsPath = "NWCOMPAT://" & serverName & "/" & objPath Set usr = GetObject(adsPath) usr.FullName = "Alice I. Wonderland" usr.SetInfo Debug.Print usr.FullName ``` -------------------------------- ### Secure Client Configuration Example Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/WebServicesDevicesApi/FileServiceSecure/readme.txt Example command-line arguments for running the secure client. It includes options for SSL hash, certificate authentication, HTTP authentication, file directory, and device address. ```text FileServiceSecureClient.exe [-SslHash ] [ [-CertAuth NULL] | [-CertAuth ] [-HttpAuth ] ``` -------------------------------- ### Create File Share Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/netds/adsi/devguide/winnt.htm This script snippet shows the initial setup for creating a file share on a computer by getting the 'LanmanServer' service object. Further methods would be needed to define the share's properties. ```vbscript Set comp = GetObject("WinNT://SEATTLE,computer") Set svc = GetObject(comp.ADsPath & "/" & "LanmanServer") ``` -------------------------------- ### Run RnrCs as a server on NT4 Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/netds/winsock/rnr2/readme.txt This example demonstrates running RnrCs as a server on an NT4 machine, focusing on the SAP name space. It shows the installation of the SAP name space class and IPX address binding. ```bash C:\>rnrcs -s -n NT4HostAhelloSrv Installing ServiceClassName: NT4HostAhelloSrv Type 200 SAP name space class installation IPX address bound... 9D36B800.00A0C9A55DC9:5DB0 Advertise server of instance name: NT4HostAhelloSrv ... Wait for client talking to me, hit Ctrl-C to terminate... received: [A message from the client: NT5HostnameC : 9D36B800.00AA00A21FF1:4638] ``` -------------------------------- ### Build RegDevice Sample using Command Prompt Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/UPnPRegisterDevice/Readme.txt Navigate to the RegisterDevice directory and use msbuild to build the RegDevice.sln solution file. ```bash msbuild RegDevice.sln ``` -------------------------------- ### Create ADSI Member using Site Server Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/netds/adsi/devguide/ss.htm Use this script to create a new member object in an Active Directory container. Ensure Site Server and ADSI are installed. The GUID generator is specific to Site Server. ```vbscript Dim oADsContainer Dim oADsNewUser Dim oGuidGen Dim strGuid Dim strLdapPath 'The path to the ou=Members container strLdapPath = "LDAP://localhost:5292/o=Microsoft/ou=Members" 'Instantiate the GUID Generator that comes with Site Server 'and store the GUID for use later on. Set oGuidGen = CreateObject("Membership.GuidGen.1") strGuid = oGuidGen.GenerateGuid 'Bind to the container in which the Member will be created. Set oADsContainer = GetObject(strLdapPath) 'Create the new user object, note that the **Create()** method returns 'an interface pointer. Set oADsNewUser = oADsContainer.Create("member", "cn=JohnDoe") oADsNewUser.Put "givenName", "John" oADsNewUser.Put "sn", "Doe" oADsNewUser.Put "userPassword", "password" oADsNewUser.Put "GUID", CStr(strGuid) oADsNewUser.SetInfo 'Destroy the objects. Set oGuidGen = Nothing Set oADsNewUser = Nothing Set oADsContainer = Nothing ``` -------------------------------- ### Build Sample with MSBuild Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/tabletpc/TipAutoComplete/ReadMe.txt Build the sample project using MSBuild from the command prompt. Ensure you are in the directory containing the solution file. ```bash msbuild TipAutoCompleteSDKSample.sln ``` -------------------------------- ### Defining ADSI Search Filter Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/netds/adsi/devguide/internet.htm Construct a search filter to specify the criteria for your ADSI query. This example searches for entries where the common name (cn), mail, surname (sn), or given name (givenName) starts with 'Loff'. ```VBScript strFilter = "(|(|(|(cn=loff*)(mail=loff*))(sn=loff*))(givenName=loff*))" ``` -------------------------------- ### Run FindPackagesByNameAndPublisherSample Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/PackageManagerFindPackagesByNameAndPublisher/README.md Execute the sample application from the command prompt, providing the package name and publisher as arguments. ```cmd FindPackagesByPublisherSample packageName publisherName ``` ```cmd FindPackagesByPublisherSample microsoft.help "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" ``` -------------------------------- ### Run RnrCs as a server on Windows 2000 Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/netds/winsock/rnr2/readme.txt This example shows how to run RnrCs as a server on a Windows 2000 machine, advertising a specific service instance name and type. It demonstrates the output including name space installation and IP address binding. ```bash C:\>rnrcs -s -n NT5HostBhelloSrv Installing ServiceClassName: NT5HostBhelloSrv Type 200 NTDS name space class installation SAP name space class installation HostName: DEMO5DC IP addresses bound... 187.91.239.60:3352 IPX address bound... 9D36B800.00C04FB9D78C:4170 Advertise server of instance name: NT5HostBhelloSrv ... Wait for client talking to me, hit Ctrl-C to terminate... received: [A message from the client: NT5HostnameC : 9D36B800.00AA00A21FF1:4636] received: [A message from the client: NT5HostnameC : 187.91.186.182:2363] ``` -------------------------------- ### Build Sample Store using MSBuild Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/security/cryptoapi/SampleStoreProvider/Readme.txt Builds the SampleStore solution using MSBuild from the command line. Ensure you are in the correct directory. ```bash msbuild SampleStore.sln ``` -------------------------------- ### Running the CreateUser Sample Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/netds/adsi/activedir/createuser/vc/readme.txt To run this sample, execute CreateUser from the command line with the necessary parameters. Ensure you have write permissions in Active Directory. The optional parameters /USER and /PASS must be provided together. ```shell CreateUser /LDAP /UNAME \ /SAMNAME [/FILE ] \ [/USER /PASS ] ``` -------------------------------- ### Get Comments from Transaction Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/PowerShell/Transactions/Transactions01/cs/Readme.txt Retrieves comments. Without '-UseTransaction', it gets all comments. With '-UseTransaction', it gets comments within the active transaction. ```powershell Get-TransactedComment ``` ```powershell Get-TransactedComment -UseTransaction ``` -------------------------------- ### Install LSP over all providers Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/netds/winsock/lsp/readme.txt Use the '-a' flag to install the LSP over all currently installed providers. This is a shortcut for specifying individual provider IDs. ```bash C:\>instlsp -i -a -n "Foobar" -d c:\windows\system32\nonifslsp.dll ``` -------------------------------- ### Build Sample with Command Prompt Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/security/cryptoapi/OCSP_Response/ReadMe.txt Compile and link the sample using MSBuild from the command prompt. Ensure you are in the correct directory. ```bash msbuild OCSP_response.sln ``` -------------------------------- ### ADSI Provider Installation Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/netds/adsi/devguide/samples.htm This C++ sample provides the installation procedure for the Active DS Sample Provider, including installing ADSI and running install.bat. ```cpp // C++ source code: [\\samples\Provider](../samples/Provider) ``` -------------------------------- ### Build Sample with Visual Studio Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/dataaccess/OPC/musicbundlesignature/readme.txt Open the .vcproj file in Visual Studio and build the solution. The output will be in the \Debug or \Release directory. ```csharp Build Solution ``` -------------------------------- ### Build using Windows SDK Source: https://github.com/microsoft/windows-classic-samples/blob/main/Samples/Win7Samples/security/x509 certificate enrollment/vc/createcngcustomcmc/Readme.txt Navigate to the sample directory in the WinSDK CMD Shell and use vcbuild to build the solution. ```bash vcbuild createCNGCustomCMC.sln ```