1. Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Simple for you. Hard for me. Help if you can.

Discussion in 'Programming & Webmastering' started by 1Strive, Jan 4, 2008.

  1. 1Strive

    1Strive New Member

    Joined:
    Dec 17, 2005
    Messages:
    682 (0.21/day)
    Thanks Received:
    30
    Location:
    Texas
    Hi everyone,
    1STRIVE here.

    I am not a programmer. I hardly ever have to write my own scripts. Batch files is about the extent of what I do. I am a windows system admin.

    I have a batch file to add shares to a cluster and I want to get it to use parameters and then pull the answers from a txt or csv file. Or I want input boxes to pop up for the answers.

    Here is what I have.

    cluster resource "MGMT1$" /create /group:"Group 00" /Type:"File Share"
    cluster resource "MGMT1$" /priv Security=Everyone,set,R:security
    cluster resource "MGMT1$" /priv Security=Administrators,set,F:security
    cluster resource "MGMT1$" /adddep:"Disk V:"
    cluster resource "MGMT1$" /priv ShareName=MGMT1$
    cluster resource "MGMT1$" /priv Path="V:\MGMT1"
    cluster resource "MGMT1$" /priv Remark=Fuji
    cluster resource "MGMT1$" /on

    This works like a champ, but I need to repeat it 50 times with different "Share Names, Disk, and Path"

    The next one would look like this.
    cluster resource "ATHMT1$" /create /group:"Group 00" /Type:"File Share"
    cluster resource "ATHMT1$" /priv Security=Everyone,set,R:security
    cluster resource "ATHMT1$" /priv Security=Administrators,set,F:security
    cluster resource "ATHMT1$" /adddep:"Disk T:"
    cluster resource "ATHMT1$" /priv ShareName=ATHMT1$
    cluster resource "ATHMT1$" /priv Path="T:\ATHMT1"
    cluster resource "ATHMT1$" /priv Remark=Fuji
    cluster resource "ATHMT1$" /on

    So, any help will be appreciated. Thanks,
    1STRIVE
     
  2. erocker

    erocker Super Moderator Staff Member

    Joined:
    Jul 19, 2006
    Messages:
    39,795 (13.19/day)
    Thanks Received:
    14,175
    Honestly as an ameteur programmer at best, I would have to do each one individually.:ohwell:
     
  3. 1Strive

    1Strive New Member

    Joined:
    Dec 17, 2005
    Messages:
    682 (0.21/day)
    Thanks Received:
    30
    Location:
    Texas
    Yeah, me too. But at least we know it can be done.:toast:
     
  4. adrianx New Member

    Joined:
    Jan 9, 2008
    Messages:
    324 (0.13/day)
    Thanks Received:
    22
    Location:
    Bucharest ROMANIA
    you can reduce your "work" if same variable are fixed :)

    a visual basic script will help you...

    but

    frist you need all the date... in 1-2 list

    also you must be sure that the list is 100% corect

    and the script must write a file ...

    cluster resource "ATHMT1$" /create /group:"Group 00" /Type:"File Share"
    cluster resource "ATHMT1$" /priv Security=Everyone,set,R:security
    cluster resource "ATHMT1$" /priv Security=Administrators,set,F:security
    cluster resource "ATHMT1$" /adddep:"Disk T:"
    cluster resource "ATHMT1$" /priv ShareName=ATHMT1$
    cluster resource "ATHMT1$" /priv Path="T:\ATHMT1"
    cluster resource "ATHMT1$" /priv Remark=Fuji
    cluster resource "ATHMT1$" /on

    and in this file the script must insert the data from the file

    also the script must sent to execution that file ... or simple to name the file with an incremented name ... same like ... file1, file 2... etc..

    and in the end you will run a script to run all the file you crated
    :D

    but ... this only helping you if you know ho to write that script..

    (it's posible to cost more time that you write manualy all the commands) :D
     
  5. adrianx New Member

    Joined:
    Jan 9, 2008
    Messages:
    324 (0.13/day)
    Thanks Received:
    22
    Location:
    Bucharest ROMANIA
    and a simple ideea

    think twice and afther that start working :)
     
  6. DanTheBanjoman Señor Moderator

    Joined:
    May 20, 2004
    Messages:
    10,553 (2.77/day)
    Thanks Received:
    1,383
    Perhaps you could look into KIX, quite a simple script language for logon scripts.
     
  7. mrtn400

    mrtn400 New Member

    Joined:
    Jan 17, 2008
    Messages:
    3 (0.00/day)
    Thanks Received:
    0
    I could help you make a small app in C++ that generates the long .bat file. You'd need to download Dev-C++ so you could compile the source.
    (Yes, just joined. Been ghosting a while and joined so I could try to help you. Normally on OCN.)

    Edit: Or I could make you the program 100% if you give me the list of "Share Names", "Disks", and "Paths".
     
    Last edited: Jan 17, 2008
  8. adrianx New Member

    Joined:
    Jan 9, 2008
    Messages:
    324 (0.13/day)
    Thanks Received:
    22
    Location:
    Bucharest ROMANIA
    mrtn400

    the list must be .. safe becouse is a list of the private network... will be a security issue to give that list to anyone.. :)

    also a good admin must know what software will run in "his" network, for that he must analise the script/source from you :)
     
  9. mrtn400

    mrtn400 New Member

    Joined:
    Jan 17, 2008
    Messages:
    3 (0.00/day)
    Thanks Received:
    0
    Ah, ok. Didn't really understand it's purpose.
     

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)

Share This Page