techPowerUp! Forums

Go Back   techPowerUp! Forums > Software > Programming & Webmastering

Reply
 
Thread Tools
Old Jan 4, 2008, 08:12 PM   #1
1Strive
500 Posts
 
1Strive's Avatar
 
Join Date: Dec 2005
Location: Texas
Posts: 667 (0.25/day)
Thanks: 58
Thanked 30 Times in 14 Posts

System Specs

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

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
__________________
Glory to "Alt 0134".
Crysis SP "Lock on with the TAC Gun!" Load a Save.
=================
Driver Tweak to not Scale/Streach 4:3 ratio on widescreen displays.
http://forums.techpowerup.com/showthread.php?t=34849
How To...Capture, Convert, and Post your PC Game Play Footage.
http://forums.techpowerup.com/showthread.php?t=11384
1Strive is offline  
Reply With Quote
Old Jan 4, 2008, 08:30 PM   #2
erocker
Senior Moderator
 
erocker's Avatar
 
Join Date: Jul 2006
Location: Milwaukee, WI.
Posts: 31,958 (12.77/day)
Thanks: 2,793
Thanked 12,320 Times in 7,832 Posts

System Specs

Quote:
Originally Posted by 1Strive View Post
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
Honestly as an ameteur programmer at best, I would have to do each one individually.
erocker is offline  
Reply With Quote
Old Jan 4, 2008, 08:42 PM   #3
1Strive
500 Posts
 
1Strive's Avatar
 
Join Date: Dec 2005
Location: Texas
Posts: 667 (0.25/day)
Thanks: 58
Thanked 30 Times in 14 Posts

System Specs

Quote:
Originally Posted by erocker View Post
Honestly as an ameteur programmer at best, I would have to do each one individually.
Yeah, me too. But at least we know it can be done.
__________________
Glory to "Alt 0134".
Crysis SP "Lock on with the TAC Gun!" Load a Save.
=================
Driver Tweak to not Scale/Streach 4:3 ratio on widescreen displays.
http://forums.techpowerup.com/showthread.php?t=34849
How To...Capture, Convert, and Post your PC Game Play Footage.
http://forums.techpowerup.com/showthread.php?t=11384
1Strive is offline  
Reply With Quote
Old Jan 16, 2008, 01:07 PM   #4
adrianx
200 Posts
 
Join Date: Jan 2008
Location: Bucharest ROMANIA
Posts: 321 (0.16/day)
Thanks: 2
Thanked 25 Times in 20 Posts
Send a message via Yahoo to adrianx

System Specs

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


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)
adrianx is offline  
Reply With Quote
Old Jan 16, 2008, 01:08 PM   #5
adrianx
200 Posts
 
Join Date: Jan 2008
Location: Bucharest ROMANIA
Posts: 321 (0.16/day)
Thanks: 2
Thanked 25 Times in 20 Posts
Send a message via Yahoo to adrianx

System Specs

and a simple ideea

think twice and afther that start working
adrianx is offline  
Reply With Quote
Old Jan 16, 2008, 01:24 PM   #6
DanTheBanjoman
Señor Moderator
 
DanTheBanjoman's Avatar
 
Join Date: May 2004
Location: Utrecht, Utrecht, The kingdom of the Netherlands
Posts: 8,498 (2.58/day)
Thanks: 41
Thanked 1,453 Times in 1,077 Posts
Send a message via ICQ to DanTheBanjoman Send a message via MSN to DanTheBanjoman

System Specs

Perhaps you could look into KIX, quite a simple script language for logon scripts.
DanTheBanjoman is offline  
Reply With Quote
Old Jan 17, 2008, 12:01 AM   #7
mrtn400
 
mrtn400's Avatar
 
Join Date: Jan 2008
Posts: 3 (0.00/day)
Thanks: 0
Thanked 0 Times in 0 Posts

System Specs

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 by mrtn400; Jan 17, 2008 at 12:07 AM.
mrtn400 is offline  
Reply With Quote
Old Jan 17, 2008, 06:41 AM   #8
adrianx
200 Posts
 
Join Date: Jan 2008
Location: Bucharest ROMANIA
Posts: 321 (0.16/day)
Thanks: 2
Thanked 25 Times in 20 Posts
Send a message via Yahoo to adrianx

System Specs

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
adrianx is offline  
Reply With Quote
Old Jan 17, 2008, 07:32 PM   #9
mrtn400
 
mrtn400's Avatar
 
Join Date: Jan 2008
Posts: 3 (0.00/day)
Thanks: 0
Thanked 0 Times in 0 Posts

System Specs

Ah, ok. Didn't really understand it's purpose.
mrtn400 is offline  
Reply With Quote
Reply


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New Build Thread bruins004 System Builder's Advice 159 Mar 5, 2013 10:53 AM
Spire MegaPOD III Frederik S Reviews 2 Sep 12, 2007 06:51 AM
Hitachi Schedules 1TB Hard Drive for Q1 2007 malware News 9 Jan 5, 2007 07:19 PM
Seagate Extends Warranty on Maxtor Internal Hard Drives malware News 1 Nov 29, 2006 04:42 PM
Hitachi to Anchor 2.5-inch Hard Drive Leadership with Quarter-Terabyte Product D_o_S News 0 Nov 2, 2006 07:22 PM


All times are GMT. The time now is 12:28 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
no new posts