+ Post New Thread
Results 1 to 6 of 6
Scripts Thread, batch file help in Coding and Web Development; Hello, need some help! im looking roll .net framework 4 out via batch simple one liner \SERVER\delivery$11\dotNetFx40.exe /q /norestart that ...
  1. #1

    Join Date
    Apr 2009
    Posts
    35
    Thank Post
    13
    Thanked 8 Times in 6 Posts
    Rep Power
    12

    batch file help

    Hello,

    need some help! im looking roll .net framework 4 out via batch

    simple one liner \\SERVER\delivery$\2011\dotNetFx40.exe /q /norestart

    that bit is nice and easy.

    what i need help with is, im pushing this out to everyone and i would like to know what PCs have been done and what ones i might need to visit.

    a notepad file with a list of hostnames for the ones that are done would be bril

    Thanks in advanced

  2. #2

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,695
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Depends how you want to do it, It's easy enough to make it add a line to a file, however you'll run into problems with a few hundreds pcs trying to write to a file at once. Overwriting eachother etc.

    Unless you don't mind doing it a bit of a longer route, and having it say make a file of the computer name, then run a seperate process/script to merge the files into one?

    Steve

  3. Thanks to Steve21 from:

    marc2510 (13th July 2011)

  4. #3

    Join Date
    Apr 2009
    Posts
    35
    Thank Post
    13
    Thanked 8 Times in 6 Posts
    Rep Power
    12
    Quote Originally Posted by Steve21 View Post
    Depends how you want to do it, It's easy enough to make it add a line to a file, however you'll run into problems with a few hundreds pcs trying to write to a file at once. Overwriting eachother etc.

    Unless you don't mind doing it a bit of a longer route, and having it say make a file of the computer name, then run a seperate process/script to merge the files into one?

    Steve
    that sounds good to me, would u mind putting the script together for me?

    even if i had to have a folder full of txt files named using the hostname, if that makes sense?

  5. #4

    Join Date
    Apr 2009
    Posts
    35
    Thank Post
    13
    Thanked 8 Times in 6 Posts
    Rep Power
    12
    Ah..

    just found this.
    setlocal

    REM ************************************************** *******************
    REM Environment customization begins here. Modify variables below.
    REM ************************************************** *******************

    REM Get ProductName from the Office product's core Setup.xml file, and then add "office14." as a prefix.
    set ProductName=Office14.PROPLUS

    REM Set DeployServer to a network-accessible location containing the Office source files.
    set DeployServer=\\FS\Office2010SourceFiles

    REM Set ConfigFile to the configuration file to be used for deployment (required)
    set ConfigFile=\\FS\Office2010SourceFiles\ProPlus.WW\c onfig.xml

    REM Set LogLocation to a central directory to collect log files.
    set LogLocation=\\FS\Office2010LogFiles

    REM ************************************************** *******************
    REM Deployment code begins here. Do not modify anything below this line.
    REM ************************************************** *******************

    IF NOT "%ProgramFiles(x86)%"=="" (goto ARP64) else (goto ARP86)

    REM Operating system is X64. Check for 32 bit Office in emulated Wow6432 uninstall key
    :ARP64
    reg query HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE\Microsoft\ Windows\CurrentVersion\Uninstall\%ProductName%
    if NOT %errorlevel%==1 (goto End)

    REM Check for 32 and 64 bit versions of Office 2010 in regular uninstall key.(Office 64bit would also appear here on a 64bit OS)
    :ARP86
    reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Uninstall\%ProductName%
    if %errorlevel%==1 (goto DeployOffice) else (goto End)

    REM If 1 returned, the product was not found. Run setup here.
    eployOffice
    start /wait %DeployServer%\setup.exe /config %ConfigFile%
    echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt

    REM If 0 or other was returned, the product was found or another error occurred. Do nothing.
    :End

    Endlocal
    by using that as a reference ill be able so what what i need

  6. #5

    Join Date
    Apr 2007
    Location
    Birmingham
    Posts
    142
    Thank Post
    6
    Thanked 45 Times in 39 Posts
    Rep Power
    22
    Something like this?

    \\SERVER\delivery$\2011\dotNetFx40.exe /q /norestart
    echo dotNetFx40.exe ran on %date% >\\SERVER\delivery$\2011\%computername%.txt

    Then you could manually run:

    dir /b \\SERVER\delivery$\2011\*.txt >>\\SERVER\delivery$\2011\allcomp.txt

    to compile a single file with all the names in.
    Last edited by andy_b; 13th July 2011 at 04:29 PM. Reason: See above hehe

  7. Thanks to andy_b from:

    marc2510 (13th July 2011)

  8. #6
    steve's Avatar
    Join Date
    Oct 2005
    Location
    West Yorkshire
    Posts
    1,043
    Thank Post
    22
    Thanked 177 Times in 123 Posts
    Rep Power
    52
    You planning the SIMS summer update too?

    Adding on to andy_b, I think this should work, checking if done already.

    Code:
    IF EXIST \\SERVER\delivery$\2011\%computername%.txt GOTO dot4_end ELSE GOTO install_dot4
    :install_dot4
    \\SERVER\delivery$\2011\dotNetFx40.exe /q /norestart
    echo dotNetFx40.exe ran on %date% >\\SERVER\delivery$\2011\%computername%.txt
    :dot4_end

  9. Thanks to steve from:

    marc2510 (13th July 2011)

SHARE:
+ Post New Thread

Similar Threads

  1. Long File Names in Batch File
    By barrystone in forum Scripts
    Replies: 17
    Last Post: 12th July 2011, 12:23 PM
  2. Help with beginner script/batch file to rename Program File?
    By El_Nombre in forum How do you do....it?
    Replies: 3
    Last Post: 23rd June 2011, 02:05 PM
  3. Batch File (select random file) help
    By fil_b in forum Windows Server 2000/2003
    Replies: 5
    Last Post: 5th November 2009, 04:13 AM
  4. batch file comman
    By jussy65 in forum Scripts
    Replies: 3
    Last Post: 13th August 2008, 07:10 AM
  5. batch file help
    By beeswax in forum Scripts
    Replies: 9
    Last Post: 3rd March 2006, 07:48 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •