C:\Documents and Settings\Hrvoje Crvelin>type 1.txt
show name
show autostart
print type:NSR group;
quit
C:\Documents and Settings\Hrvoje Crvelin>type 2.txt
show name
show autostart
print type:NSR group; name: Default
update autostart: Enabled
show name
show autostart
print type:NSR group; name: Default
quit
C:\Documents and Settings\Hrvoje Crvelin>nsradmin -i 1.txt
name: Default;
autostart: Disabled;
C:\Documents and Settings\Hrvoje Crvelin>nsradmin -i 2.txt
name: Default;
autostart: Disabled;
updated resource id 66.0.108.10.179.187.126.68.192.168.1.11(13)
name: Default;
autostart: Enabled;
Here you go...put the following syntax in a .bat file and run it. Make sure this is on the NetWorker server as it will fail if it's on a different system.
@Echo Off Echo show name;autostart >t1.tnf Echo print type:NSR group >>t1.tnf Echo update autostart: Disabled; nsradmin -i t1.tnf |find "name" >>grpname.tnf Echo Current Groups in NetWorker >grpnames.txt Echo ------------------------------------------ >>grpnames.txt For /F "tokens=2 delims=; " %%a in (grpname2.tnf) do Echo %%a >>grpnames.txt Del t1.tnf Del grpname.tnf Cls Echo Please view the text file "grpnames.txt" for the list of group names.
You could install MS Windows services for UNIX or Cygwin package to support UNIX commands. The major trouble I found with native Windows is lack of support for scripting as on native UNIX systems.
This script is for Windows. To answer your questions:
At the beginning, it states "show name;autostart" should the ; be a : ? No the semi colon ; is a separation of fields to show. The colon : is used to identify a value for the field.
Further, should the 3rd line - Echo update autostart: disabled also be >t1.tnf? Yes, sorta. It should be >>t1.tnf as you want to append to what's already there. The single > is use to output to a file overwriting what's currently in it. The double >> is used to append to the file. The "Echo update autostart: Disabled;" line needs to have a capital D in it and not a lower case.
ble1
6 Operator
•
14354 Posts
•
56186 Points
633
0
Posted June 11th, 2006 04:00