Guy’s Best Practice & Litmus Tests Ezine #17
- NetSH, CACLS
Two classic command line tools. One day you may need to use these
utilities in a script.
Contents for Ezine #17Cacls is the classic utility for altering permissions on files and folders.
Generally I prefer to use Explorer, but when you need to script repetitive
tasks, then Cacls comes into its own.
If you wish to accept my Cacls challenge then this what you should do.
0) Get Cacls – download CACLS.
1) Create a C:\Guy folder (Change guy to yourname if I were you)
2) Copy files, any files will do, into this C:\Guy folder. Also copy cacls.exe
from the link
3) Run, CMD. Once you have your ‘DOS box’ then type – cacls
4) Have a look through the commands for ideas.
5) The famous wildcard *.* works well for the file names.
6) Challenge: set the permissions to read only. Type this: cacls *.* /G
everyone:r
7) If you get a prompt y/n then just type y.
NetSH is the classic network shell program. As with Cacls, I prefer alternative
techniques, such as: Remote Desktop, Terminal server, even Telnet. However, the NetSH does have a place in your tool kit
If you accept my challenge then either get NetSH from the resource kit, or
from this link to my site.
Install into the %systemroot%system32\ folder.
Challenge A
1) Run Cmd, then in the ‘DOS’ box type netsh.
2) What you should see is netsh>
3) Make liberal use of Show, Set, and Help
4) Type: interface. What you should see is: netsh interface>
5) Next type: ip. What you should see is netsh interface ip>
6) Now try SHOW. I hope this will give you ideas for configuring
TCP/IP
Challenge B
1) One of the best uses of NetSH is to configure a remote machine.
2) Assume that you have a machine called REMOTE on your network.
3) Type this: netsh set machine REMOTE. What you should see is: [remote] netsh>
4) Now repeat Challenge A (above)
5) Well I you have added NetSH to your tool kit.
Download NetSH and CACLS.
Their topics and material are ideal for getting you started with VBScript. The
videos are easy to follow and you can control the pace. Try their free demo material and then see if you want to buy the full package.
See more about VB Script Training CD.
|