Computer Hope

Microsoft => Microsoft DOS => Topic started by: Twinturbo120 on May 11, 2010, 09:33:59 PM

Title: I need help creating a batch file!
Post by: Twinturbo120 on May 11, 2010, 09:33:59 PM
I'm new here but anyway, I need help creating a batch file that creates a folder in the root of the C drive with the same
name as the computer. The script should run the Gpresult.exe program for the Administrator User and the computer scope
and send RSoP data output to a file name Gpresult.txt in the directory it was created.

This was given to me as a H/W assignment at my school lol but I seriously need some help.
I'm thinking doing stuff with ns, but with ns the only thing I know how to do is set up
a network drive.
Title: Re: I need help creating a batch file!
Post by: marvinengland on May 11, 2010, 11:08:35 PM
C:\>type winturbo.bat

Code: [Select]
@echo off

cd  \
md %COMPUTERNAME%

cd %COMPUTERNAME%

Gpresult /R  >  Gpresult.txt

type Gpresult.txt


Output:

C:\>winturbo.bat

Microsoft (R) Windows (R) Operating System Group Policy Result tool v2.0
Copyright (C) Microsoft Corp. 1981-2001

Created On 5/12/2010 at 12:05:13 AM


RSOP data for Marvin : Logging Mode
-----------------------------------------------------

OS Configuration:            Standalone Workstation
OS Version:                  6.1.7600
Site Name:                   N/A
Roaming Profile:             N/A
Local Profile:               C:\Users\Marvinl
Connected over a slow link?: No


COMPUTER SETTINGS
------------------

    Last time Group Policy was applied: 5/11/2010 at 11:36:44 PM
   
    Group Policy slow link threshold:   500 kbps
    Domain Name:                        37L4247D28-05
    Domain Type:                        WindowsNT 4

   
    The following GPOs were not applied because they were filtered out
    -------------------------------------------------------------------
        Local Group Policy
           
    The computer is a part of the following security groups
    -------------------------------------------------------
        System Mandatory Level
   
       
        This Organization
                BITS
        CertPropSvc
        EapHost
        hkmsvc
        IKEEXT
        iphlpsvc
        LanmanServer
        MMCSS
        MSiSCSI
        RasAuto
        RasMan
        RemoteAccess
        Schedule
        SCPolicySvc
        SENS
        SessionEnv
        SharedAccess
        ShellHWDetection
        wercplsupport
        Winmgmt
        wuauserv
        LOCAL
       

USER SETTINGS
--------------

    Last time Group Policy was applied: 5/11/2010 at 11:37:02 PM
    Group Policy was applied from:      N/A
    Group Policy slow link threshold:   500 kbps
    Domain Name:                        MarvinPC
    Domain Type:                        <Local Computer>

    Applied Group Policy Objects
    -----------------------------
        N/A

    The following GPOs were not applied because they were filtered out
    -------------------------------------------------------------------
        Local Group Policy
            Filtering:  Not Applied (Empty)

    The user is a part of the following security groups
    ---------------------------------------------------
        None
        Everyone
       This Organization
       
        C:\MarvinPC>
Title: Re: I need help creating a batch file!
Post by: Dusty on May 12, 2010, 02:08:32 AM
This was given to me as a H/W assignment at my school lol but I seriously need some help.

When you turn in work done by someone else your tutor may believe that you understood the assignment and do not need any further assistance.  This won't be good when you come to an exam environment when there's no-one to do your work for you.   Any assistance with homework should come from your tutor.

Welcome to the CHope forums where an unwritten rule is that we may advise where to get the required information but we shy away from doing homework for anyone.

Title: Re: I need help creating a batch file!
Post by: Twinturbo120 on May 12, 2010, 08:24:18 AM
C:\>type winturbo.bat

Code: [Select]
@echo off

cd  \
md %COMPUTERNAME%

cd %COMPUTERNAME%

Gpresult /R  >  Gpresult.txt

type Gpresult.txt


Output:

C:\>winturbo.bat

Microsoft (R) Windows (R) Operating System Group Policy Result tool v2.0
Copyright (C) Microsoft Corp. 1981-2001

Created On 5/12/2010 at 12:05:13 AM


RSOP data for Marvin : Logging Mode
-----------------------------------------------------

OS Configuration:            Standalone Workstation
OS Version:                  6.1.7600
Site Name:                   N/A
Roaming Profile:             N/A
Local Profile:               C:\Users\Marvinl
Connected over a slow link?: No


COMPUTER SETTINGS
------------------

    Last time Group Policy was applied: 5/11/2010 at 11:36:44 PM
   
    Group Policy slow link threshold:   500 kbps
    Domain Name:                        37L4247D28-05
    Domain Type:                        WindowsNT 4

   
    The following GPOs were not applied because they were filtered out
    -------------------------------------------------------------------
        Local Group Policy
           
    The computer is a part of the following security groups
    -------------------------------------------------------
        System Mandatory Level
   
       
        This Organization
                BITS
        CertPropSvc
        EapHost
        hkmsvc
        IKEEXT
        iphlpsvc
        LanmanServer
        MMCSS
        MSiSCSI
        RasAuto
        RasMan
        RemoteAccess
        Schedule
        SCPolicySvc
        SENS
        SessionEnv
        SharedAccess
        ShellHWDetection
        wercplsupport
        Winmgmt
        wuauserv
        LOCAL
       

USER SETTINGS
--------------

    Last time Group Policy was applied: 5/11/2010 at 11:37:02 PM
    Group Policy was applied from:      N/A
    Group Policy slow link threshold:   500 kbps
    Domain Name:                        MarvinPC
    Domain Type:                        <Local Computer>

    Applied Group Policy Objects
    -----------------------------
        N/A

    The following GPOs were not applied because they were filtered out
    -------------------------------------------------------------------
        Local Group Policy
            Filtering:  Not Applied (Empty)

    The user is a part of the following security groups
    ---------------------------------------------------
        None
        Everyone
       This Organization
       
        C:\MarvinPC>

Wow thank you sir for your kind help much appreciated!