A friend of mine posed a problem to me recently that I was able to solve using old MS-DOS command line tricks. Recently I have been doing a good bit of work in HP-UX with Oracle since I am the backup for our Oracle DBA. One thing that has done is to make me revisit the command line, something that I haven't had to deal with very much in recent years. So I also started playing around with some stuff in the Windows Command line as well for how to automate certain tasks. Take for instance, to output the results or text of executing a process at the command line, you can pump it to a file:
process >> process_log.txt
One of the hardest things I had to remember was how to provide responses to prompts. Take for instance the rskeymgmt utility that is used to extract the encryption key from Reporting Services for safe keeping. No matter what switches you provide to the commandline call, it still always asks "Are you sure you want to extract the key from the Report Server? Yes(y)/No(n)". To get around this, you can create a text file called prompts.txt with a single like that has a letter Y . Then you provide this file as the input for prompts:
rskeymgmt < prompts.txt
What is crazy is that when I was younger, basically a script kiddy, this kind of stuff was very common place in the windows world, because the GUI wasn't always there.
No comments:
Post a Comment