script to rename folder in all 238 machines - Windows NT

This is a discussion on script to rename folder in all 238 machines - Windows NT ; I am writing a script such that it will connect to every single pc we have in the building and will rename a folder on every machine ( about 228 machines). The folder is basically a users local profile, so ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: script to rename folder in all 238 machines

  1. script to rename folder in all 238 machines

    I am writing a script such that it will connect to every single pc we
    have in the building and will rename a folder on every machine ( about
    228 machines). The folder is basically a users local profile, so on an
    NT machine it is C:\WINNT\Profiles\profilename and on 2k machines it
    is C:\Documents and Settings\profileneam. So far the only solutions
    that I've been able to come up with is to have a script that uses net
    use here is a sample of the code

    echo


    net use n: \\sfsmk179\C$
    n:
    cd Documents and Settings\
    rename t4pmb t4pmb.old
    C:
    net use n: /delete

    net use o: \\sfsmk179\C$\WINNT\Profiles
    o:
    rename t4pmb t4pmb.old

    C:
    net use o: /delete

    Basically, i use two drive letters one will connect to an NT machine
    (drive o and one will connect to a 2k (drive n.

    and will just throw the commands to rename the foldes. My concern is
    that sometimes when I am about to disconnect drive o: (and only
    happens to drive o I get a prompt saying

    "There are open files and/or incomplete directory searches pending on
    the
    connection to o:.

    Is it OK to continue disconnecting and force them closed? (Y/N) [N]:"

    This is a nuisance because it defeats the purpose that my script
    should run unsupervised, what do I need to add so that I'll override
    such not and always say yes.

    Thanks for those who responds

  2. Re: script to rename folder in all 238 machines

    Sorry about the delay.

    Don't worry about the net use.
    Do you have a spreadsheet program like excel?
    Run net view >c:\net.list, import it into the spread sheet.
    in col. a put \\, col b would be the PC names you imported (if comments
    appear in col c delete them), col c would be ren \c$\winnt\profiles\*
    *.old, then in col d put it equal to =a1&b1&c1
    fill down or copy down col's a, b, and d. copy col d to notepad.
    Then replace winnt in col c with docume~1, and copy the resulting changes in
    col d to the bottom of the notepad file. save the notepad file as
    something.bat

    PS get rid of the end results of the net view command at the bottom of your
    ..bat for S.sheet.

    Elk



    PGB wrote in message
    news:6fcc07c.0309021317.62282c14@posting.google.co m...
    > I am writing a script such that it will connect to every single pc we
    > have in the building and will rename a folder on every machine ( about
    > 228 machines). The folder is basically a users local profile, so on an
    > NT machine it is C:\WINNT\Profiles\profilename and on 2k machines it
    > is C:\Documents and Settings\profileneam. So far the only solutions
    > that I've been able to come up with is to have a script that uses net
    > use here is a sample of the code
    >
    > echo
    >
    >
    > net use n: \\sfsmk179\C$
    > n:
    > cd Documents and Settings\
    > rename t4pmb t4pmb.old
    > C:
    > net use n: /delete
    >
    > net use o: \\sfsmk179\C$\WINNT\Profiles
    > o:
    > rename t4pmb t4pmb.old
    >
    > C:
    > net use o: /delete
    >
    > Basically, i use two drive letters one will connect to an NT machine
    > (drive o and one will connect to a 2k (drive n.
    >
    > and will just throw the commands to rename the foldes. My concern is
    > that sometimes when I am about to disconnect drive o: (and only
    > happens to drive o I get a prompt saying
    >
    > "There are open files and/or incomplete directory searches pending on
    > the
    > connection to o:.
    >
    > Is it OK to continue disconnecting and force them closed? (Y/N) [N]:"
    >
    > This is a nuisance because it defeats the purpose that my script
    > should run unsupervised, what do I need to add so that I'll override
    > such not and always say yes.
    >
    > Thanks for those who responds




+ Reply to Thread