Run Batch File for Domain Computers on Startup

Hello,
I am trying to run a batch file I created to grab computer specs off of every computer on our domain.  I have created a new GPO under my domain and under there I have the file sitting under Computer configuation>policy>windows settings>scripts>startup
and also computer configuation>policy>administrative template>system>run these programs at startup.  Neither one seems to be working... I know the batch file works because I have tested it on multiple computers.  Here is what the file
looks like:
@echo off
call :test >> \\10.0.2.3\users\rricks\computerinfo\%ComputerName%.log
goto :eof
:test
wmic csproduct get identifyingnumber,name,vendor
wmic os get osarchitecture
wmic os get name
wmic os get installdate
wmic computersystem get name
wmic computersystem get username
wmic computersystem get totalphysicalmemory
wmic baseboard get serialnumber
wmic cpu get name
I have also tried putting this file in the netlogon share folder on our DC with no luck.  Let me know what Im doing wrong.  Any help would be greatly appreciated.
Thanks,
Ryan

> call :test >> \\10.0.2.3\users\rricks\computerinfo\%ComputerName%.log
Who has access to this shared folder you are piping to? Did you try
piping to a local file? %public%\blah.log :)
Martin
Mal ein
GUTES Buch über GPOs lesen?
NO THEY ARE NOT EVIL, if you know what you are doing:
Good or bad GPOs?
And if IT bothers me - coke bottle design refreshment :))

Similar Messages

  • Batch file for IE settings

    Hi everybody,
    I want to make some changes to IE settings of many PCs to be able to open a tool which willl be used by all users using the systems..
    Since same settings are to be applied to different systems. I want to create a batch file for it .
    Settings are :
    1.Go to internet Options-- security--sites--trusted sites and and the site
    https://abc.com under it
    2.Set security level for this zone as Low
    3.Check enable protected mode
    4.Go to internet options--settings--privacy and uncheck Turn on Pop-up blocker
    5.Go to tools--compatibility view settings and the site
    https://abc.com under it . Check option - display intranet sites
    in compatibility view
    I did some research on net and found that all these settings are done by changing entries in registery.
    The site http://support.microsoft.com/kb/182569 gave lot of info on what various codes mean . But since I am new to creating
    batch files , it does not help me in writing commands. Little more research showed me that my commands would be something like
    reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings" /.....................
    However I cannot use trial and error as any unwanted change to registery may cause damage to my systems .
    It would really be very helpful if anyone can help me with his/her expertise in batch files and reg files.
    My target will be for IE8/9/10/11 preview . I am assuming the commands would be same for these versions which are comparitively new.
    Thanks,
    Mani
    manISRT

    Hi,
    this is a very broad topic, with quite a few scenarios, and potentially lots of complexity.
    Here are some thoughts I have written down for you to consider:
    Firstly, you really need to understand the basics of IE Zones, and how it is that addresses are categorised into each zone.
    There are default settings for each zone, and these are initially defined by MS, but you, or the user can, and may, have changed which zone is active, in which situation.
    E.g., if you are dealing with pc's in your organisation and under your control, vs pc's not in your organisation and/or not under your control.
    For pc's which are in your organisation, are they used only inside your office network, or are they also used outside your office network?
    Are the pc's under your control managed by Active Directory (are they members of your organisation's AD Domain?
    Does your office network use a network firewall or proxy, and the pc's inside gain access to the internet by "traversing" this proxy?
    Is the website you mention, "inside" your organisation's network, or, "outside" your organisation's network?
    If outside, how do your organisation's pc's currently become configured for internet access?
    Do they have configurations applied to the pc's, such as proxy settings? If so, does this use Proxy Auto Configuration (PAC) or INS, such as wpad.dat or proxy.pac?
    Note that if you adjust site-to-zone settings, and/or settings for a particular zone, other websites which are categorised into that zone will also attract the adjusted settings, so you need to ensure that any changes you make, are suitable for those other
    websites too.
    Is the website address part of your organisation's domain name, or a domain name that you already have particular settings for?
    Is the website/address and the content upon it controlled by your organisation?
    For compatibility view, depending upon the IE browser version, there are different methods available, you may not need to adjust the browser settings if the webpages are suitably constructed:
    Does the website specify <!DOCTYPE  ?
    Does the website supply X-UA-Compatible metatag?
    You can deliver most settings for IE in a few different ways:
    - AD GPO (you can use Group Policy Admin Templates, or, Group Policy Preferences)
    - IEAK (you can deploy a settings package with or without deploying a version of the browser)
    - registry settings (which you can deploy using scripts or batch files)
    - get the user to manually apply the settings via the user interface
    Note that some settings may need to be applied per-user (HKCU) and some settings are per-machine (HKLM).
    If you have a multi-user or hotdesk scenario (where more than a single user, uses the same machine), this might require you to re-apply the settings for each and every user.
    E.g.:
    Your organisation is wanting to use a hosted web application, accessed from inside your organisation, but it is hosted outside your ogranisation.
    The address is http://contoso.websales.hosterxyz.com
    You examine your existing pc configurations and determine that the IE Trusted Sites zone is not currently in use by any standard configurations.
    The hosted web application requires IE Protected Mode to be disabled (because of some special functions/features).
    You examine the default settings of the IE Trusted Sites zone, and observe that the Trusted Sites zone already has Protected Mode disabled.
    You decide to categorise the website "http://contoso.websales.hosterxyz.com" as a Trusted Site.
    On a test pc, you manually add the website "http://contoso.websales.hosterxyz.com" to Trusted Sites, and test the web application is operating correctly.
    You then create an AD GPO, which adds this website address into the Trusted Sites zone, and link/apply/deploy this GPO within your AD.
    Your organisations computers automatically read, process and apply this GPO, and all computers are now configured for this website as a Trusted Site.
    Note that if you use the "classic" GPO methods (Admin Templates), users can no longer manually adjust websites in or out of the Trusted Sites zone, because when "classic" GPO is deployed, it removes the ability for users to adjust these
    settings manually.
    This may be suitable for your organisation, or, unsuitable - it depends upon the degree of "freedom" you wish/need to allow.
    Alternately, you could use IEAK or GP Preferences, to deploy the Trusted Sites settings - these two methods allow the end-user to manually adjust if they choose. This means the end-user can remove the settings you deployed.
    Again, this may (or not) suit your scenario.
    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

  • PDQ - run batch file on user current folder...

    Hi,
    I'm running batch file:
    cd %USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files\
    but it's not opening the current logged on user
    how to deploy it on current logged on user?
    thanks,,,
    This topic first appeared in the Spiceworks Community

    This is not working for me in Windows 8.  I have a shortcut to an EXE file located in"C:\Users\admin\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup".  If I set the shortcut to run as administrator (screenshot attached) then it does
    not run at all on startup.  If I uncheckmark "Run as Administrator" then it starts fine (but does not have enough privileges to do what it needs to do).  In Windows 7 this was not an issue since the current user was a local administrator and did
    not need to elevate its privileges further.
    Any ideas how I can work around this problem?  Thanks!
    Ugh... it won't let me attach a screenshot until my "account is verified", whatever that means.

  • HOw to create a Batch file for java application and whats the use of this ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    First of all, you're OT.
    Second, you can find this everywhere in the net.
    If you got a manifest declaring main class (an classpath if needed), just create a file named whatever.bat, within same directory of jar file, containing:
    javaw -jar ./WhateverTheNameOfYourJarIs.jar %*By the way, assuming a Windows OS, you can just double click the jar file (no batch is needed).
    Otherwise use:
    javaw -cp listOfJarsAndDirectoriesSeparedBySemiColon country/company/application/package/className %*Where 'country/company/application/package/' just stands for a package path using '/' as separator instead of '.'
    Don't specify the .class extension.
    Javaw only works on Windows (you asked for batch, I assumed .BAT, no .sh), in Linux please use java.exe (path may be needed, Windows doesn't need it 'cause java's executables are copied to system32 folder in order to be always available, see PATH environment variable if you don't know what I'm talking about) and use ':' as classpath (cp) separator.
    The '%***' tail is there in order to pass all parameters, it only works on Windows, refer to your shell docs for other OSs (something like $* may work).
    This way you have a command you can call to launch your code (instead of opening NetBeans just to see your app working). You could schedule tasks on it or just call it in any command prompt (hope you know what it is 'cause there have been people in this very same forum with no clue about it, if not just hold the 'Windows button' and press 'R', then type 'cmd' and run it).
    Finally add dukes and give 'hem away.
    Bye.

  • Running batch files thraugh java by passing parameters

    Hi
    I want to run a batch file by passing some parameters.
    Eg: copy.bat "D:\live\hoe.txt" "D:\test"
    while doing this from command prompt its working and i have written some java code for running this batch file.
    String live="D:\\live\\how.txt";
    String test="D:\\test";
    String bat="D:\\copy.bat";
    String[] command = new String[3];
    command[0] = bat;
    command[1] = live;
    command[2] = test;
    try {
    Runtime.getRuntime().exec(command);
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    but this time its not copying the file;
    Please help.

    Just another cross poster.
    [http://www.java-forums.org/new-java/15005-running-batch-files-thraugh-java-passing-parameters.html]
    db

  • How to run batch file from oracle forms 9i

    Hi everyone.
    i have a data in csv file. i want to upload it to my database. i am using sql loader for it.
    i have made a batch file which run the sql loader and transfer my data to database.
    How to run batch file from oracle forms 9i.
    when i press the button, nothing uploads in my database. (when i simply run the batch file it works).
    here is my code
    Begin
    HOST('C:\temp\batchfile.bat');
    message('done');
    end;
    Thanks in advance
    regards
    sajid

    this is my log file, when i run manually.
    SQL*Loader: Release 10.2.0.1.0 - Production on Thu Jul 1 23:27:53 2010
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Control File: file_to_upload.ctl
    There are 2 data files:
    Data File: sk.csv
    Bad File: sk.bad
    Discard File: none specified
    (Allow all discards)
    Data File: sk1.csv
    Bad File: sk1.bad
    Discard File: none specified
    (Allow all discards)
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 50
    Bind array: 64 rows, maximum of 256000 bytes
    Continuation: none specified
    Path used: Conventional
    Table KHAN, loaded from every logical record.
    Insert option in effect for this table: APPEND
    Column Name Position Len Term Encl Datatype
    SR FIRST * , O(") CHARACTER
    DATES NEXT * , O(") CHARACTER
    AGENT NEXT * , O(") CHARACTER
    COUNTRY NEXT * , O(") CHARACTER
    TRANSACTIONS NEXT * , O(") CHARACTER
    PKR NEXT * , O(") CHARACTER
    USD NEXT * , O(") CHARACTER
    BANK NEXT * , O(") CHARACTER
    Table KHAN:
    11088 Rows successfully loaded.
    0 Rows not loaded due to data errors.
    0 Rows not loaded because all WHEN clauses were failed.
    0 Rows not loaded because all fields were null.
    Space allocated for bind array: 132096 bytes(64 rows)
    Read buffer bytes: 1048576
    Total logical records skipped: 0
    Total logical records read: 11088
    Total logical records rejected: 0
    Total logical records discarded: 0
    Run began on Thu Jul 01 23:27:53 2010
    Run ended on Thu Jul 01 23:27:54 2010
    Elapsed time was: 00:00:00.63
    CPU time was: 00:00:00.17

  • Can't run batch file in Windows 2008 R2

    Trying to run batch file (manually first) with powershell commands.
    Powershell commands work fine thru powershell but the batch file will not execute manually.
    I am trying to run as administrator.
    Is there a permission  or policy I may be missing?
    Thanks
    Dave
    Dave Kozlowski

    Hi,
    Some bat type command can't run in the powershell environment, you must confirm you have choiced the correct lunch tools.
    Hope this helps.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Can't run Batch files or Devnev (visual studio) - is not recognized .. command

    Getting the famous error :
    ... is not recognized as an internal or external command`*
    When & Where :
    not sure about the total range of the problem,
    Here I can't run batch files and "devneve.exe"
    sample Batch could be :
    @echo off   
    clr
    'clr' is not recognized ...
    **Here are the keynotes:**
     1. I run it as an admin (cmd)
     2. The Path variable seems to have anything needed, Powershell's path is also there sys32..v1
     3. I'm going into the current directory of devnev.exe ...
     4. ran also "devnev.exe"
     5. I don't have 2 cmd s in a known folder
     6. the autorun registries for command prompt were deleted
     7. the cmd extensions were disabled and re-enabled
     8. Avast IS 9 is running,
     9. The system seems to be fine
     10. all .Net frameworks are installed
     11. for a test jetAudio or ILDasm could be executed from the cmd
    Win 8.1 Pro , CPU i7, VS 2013 upd2

    thanks,
    this was one of the silliest problems I've ever encountered, my bad fault,
    the file is DevEnv not DevNev...!
    but about the clr, don't know from when I added them to my batches, but I'm sure the scripts were working correctly a time ago, maybe by a mistake I changed them, I thought it is the most known command, but I was wrong, there is a long time gap between me
    and DOS.

  • Running batch file

    Hi,
    i am running a batch file from a java program. But in the batch file, the home is set to a relative path like .. (two dots) and in the batch file i am yet setting the classpath for running another java application. the main class of the application is in the jar file set in the classpath and when i am trying to run the java program, when i call the batch file, using Runtime.exec(), it says no class def found error since it is unable to locate the main class specified in th jar file.
    can anybody suggest as to what i can do so that my application may run to ecexution.?
    Thanks

    Call a 'regular' java class from the JSP and read :
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps_p.html
    Keep in mind that possibly hundreds of client user threads will be accessing your JSP page...Are you going to run a batch file for each request that you receive?

  • Batch file for Export Job

    Hi,
    We created an OS batch file for our daily exports (backups). This file is scheduled to run daily at 7:00 P.M. A test run showed that it did not work. Can somebody find an error in the script?
    rem ***** SAMPLE BATCH FILE TO DO DAILY EXPORT ******
    @echo Export started at:
    @echo
    date /T
    time /T
    rem Here's a one-line NT command (But a long line!)
    rem one that splits all the date parts out, outting
    rem each one into it's own variable (weekday, day, month, year)
    for /f "tokens=1-4 delims=/ " %%a in('date /t') do
    (set=weekend=%%a& set day=%%b& set month=%%c& set year=%%d)
    set logfile=%year%_%month%_%day%.log
    set expfile=%year%_%month%_%day%.exp
    set ORACLE_SID=BDC
    set ORACLE_HOME=D:\oracle\product\10.2.0
    exp system/bdcadmin@bdc full=y grants=y file=D:\export\bdc.dmp log=D:\export\bdc.log compress=N
    @echo Export completed at:
    @echo
    date /T
    time /T
    rem ************* END OF BATCH FILE *********************
    Thank you!

    You can straight away use this batch file after modifying the exp line with your machine details and schema name.
    @echo off
    if %1/==:/ goto %2
    if NOT %1/==/?/ goto Begin
    for %%C in (echo. goto:End) do %%C
    :Begin --------------------------------------------------------------
    if NOT errorlevel 1 %0 : %OS%Parse MM DD
    %0 : %OS%Parse DD MM
    :Windows_NTParse ----------------------------------------------------
    for /f "tokens=1-4 delims=/.- " %%A in ('date /t') do (
    set Dow=%%A&set %3=%%B&set %4=%%C&set YYYY=%%D&goto End)
    :Parse --------------------------------------------------------------
    for %%C in (md cd) do %%C @tmp@
    %COMSPEC% /e:2048 /c ~tmp1.bat > ~tmp2.bat
    call ~tmp2
    if NOT errorlevel 1 goto Slash
    lfnfor on > "%_D%.-"
    ren "%_D%.-" "??? ?? ?? ????"
    for %%F in ("??? ?? ?? ????") do set _D=%%F
    lfnfor off
    :Slash
    for %%S in ("%3=%%%4%%" "%4=%%YYYY%%" "YYYY=%%1") do echo set %%S>>~tmp1.bat
    for %%S in (%_D%) do call ~tmp1 %%S
    if errorlevel 1 goto Cleanup
    %COMSPEC% /e:2048 /c ~tmp1.bat > ~tmp2.bat
    call ~tmp2
    :Cleanup
    for %%C in ("set _D=" cd.. "deltree /y @tmp@ > NUL") do %%C
    :End ----------------------------------------------------------------
    exp system/oracle file=D:\Backup\PERF_4.2_%yyyy%%mm%%dd%.dmp log=D:\Backup\PERF_4.2_%yyyy%%mm%%dd%.log owner=TEST
    ****************************************************************************************

  • How to create a Batch file for java application  ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    [http://static.springsource.org/spring-batch/]
    Assuming you want to develop a batch application rather than actually just create a .bat file ..

  • HOST IN 10g to run batch file on application server

    Hi,
    I am trying to deploy a form from 6i to 9i. the form use Host builtin to run batch file on machine. this works fine when i run form on client server environment. but when i run the same form after compiling in 9i and run on 3 tier model and try to run batch file from form it give me error that
    'ftp' is not recognized as an internal or external command,
    operable program or batch file.
    any suggestion?

    It could be because the Host session doesn't have any environment variables set i.e. there is no PATH variable, so it simply doesn't know where to look to find the 'ftp' executable. You could try supplying the explicit path of the ftp executable and see if that works. (This was a problem I had running Host commands on a Unix application server.)
    James

  • Error running batch files from java source file???

    Dear Friends,
    hi,
    this is with response to a doubt i had earlier ,
    i want to run batch files from the java source file ,i tried using this code (here batrun is the batch file name that contains commands to run other java files)
    try
    String [] command = {"c:\\vishal\\finalmain\\batrun"};
    Runtime.getRuntime().exec(command);
    catch(Exception e)
    but i got the following error.
    java.io.IOException: CreateProcess: gnagarrun error= 2
    plz. help me, i tried all combination w/o success,
    in anticipation(if possible give the code after testing)
    Vishal.

    hello there,
    i solved the prob. by using
    cmd /c start filename ,but i need to pass parameters ie
    cmd /c start java "c:/vishal/runfile a b" where a and b are the parameters. but it is not accepting this in Runtime.getRuntime.exec(),
    any solutions ?????????
    regards,
    Vishal

  • Unable to run batch files in my EP server

    Hi,
       I'am unable to run batch files(go.bat and configtool.bat) on my EP server.Anbody please give me a solution.
    With Regards
    Pradeep.B

    If your EP Server is on non-windows based environment then you cannot use go.bat & configtool.bat or else you can. If you are trying to execute these on unix based machines then you have to use go.sh & configtool.sh files.
    Pradeep

  • Unable to run batch file through BO XI 3.1 server

    IHi,
    I am unable to run batch file (.bat) from BO XI CMC. the batch file is running fine through command prompt but fails at server. Error msg is "Running this type of program is disabled by your administrator".
    Can you help?
    Thanks in advance,
    Avijit

    Have your administrator enabled the running of that type of program in the CMC?
    Sincerely,
    Ted Ueda

Maybe you are looking for

  • Screen dimming issue (?)

    Hi, sometimes, (usually when web surfing) my screen dims on its own, at first I thought there was a problem with the screen, but then I realized that the brightness meter does go down, and raises again if I press the brightness button, BUT when its g

  • Login to Infoview / cmc is slow

    Hi all!! I'm using a BOE XI 3.1 SP2 with Apache Tomcat Was, in a Windows 2008 VMware image... Login times  to InfoView and CmcApp with entreprise authentification are about 2 minutes or more than sometimes. And after login,some page take time ,for ex

  • GETWA_NOT_ASSIGNED dump  in me21n

    Hi, While creating ME21N user getting this error  "GETWA_NOT_ASSIGNED dump ". please tell me the OSS notes or any solution. Client.............. 600 User................ "RINFMFGS" Language key........ "P" Transaction......... "ME21N " Program.......

  • I-pod classic 80gb loading problems

    i have just bought an 80gb classic. i have een able to load songs on no problems but when i put the contacts that i had on from my p.c. i found it would only load 1/4 of the list then nothing (this is using micosoft office outlook)can anyone help?

  • One track instead of rows of images

    I noticed that you have on track to work with, which makes it difficult to work with with a large slide show or movie. Is it possible to view your images in rows to better move your images around?