I am currently working in a secondary school in Birmingham. I want to learn how to create batch files I have used the internet and learnt the basic commands. Can you please direct me to books or useful websites that I could use to carry out the following task:
Value that needs to be changed (current data value):
Value Name = Path
Value Data = C:\Program Files\XMind
I would like to change the value to the following file location:
Value Name = Path
Value Data = C:\Documents and Settings\All Users\Documents\XMind
We are using Windows XP
Registry Editor Version is "Windows Registry Editor Version 5.1"
The main reason for this is because we have bought new software and we have installed it on various machines and now I need to go back and edit the regedit values for it (i need to change the file location where the temp files will be saved to make sure the softwrae operates correctly). It will be ideal to create a batch file and use it as a startup logon script. But I do not know how to do this as I am a junior ICT Technician in my first job. Can someone please help me out I would really appreciate it.
Thanks in advance,
Last edited by richrad_mills; 10th June 2010 at 09:15 PM.
I was hoping someone can guide me through the coding because I need to sort this problem out before the summer term ends. I am running the entire school on my own as my manager has gone on paternity leave and he won't be back and the software is needed 3 days before he comes back.
If you're using Group Policy (and so you're aware of the options) you can write ADM Templates to control registry settings from Group Policy Mangement Console.
Here's an example showing how to change the reg key you wanted:
; Custom ADM template for XMind.
; Created by Brian Henry.
POLICY "XMind Options"
PART "File location where the temp files will be saved:" EDITTEXT REQUIRED EXPANDABLETEXT DEFAULT "C:\Program Files\XMind"
PolicyDescription="Changes the file location where the temp files will be saved for XMind."
There are instructions for adding it to a Group Policy Object at petri.co.il.
I think this is out of date if you're using Server 2008, but i'm not yet so haven't learned about admx files myself. You can also change registry settings using Group Policy Preferences.
I would avoid actual batch files as they're well out of date now. VBScripting (Windows Scripting Host) and PowerShell are the current Microsoft ones in use. Batch files won't let you control as much as they can.
As well as making this script in the batch language I would also aim to make this script in VB script as well. They will both do the same thing but this way you can learn 2 different languages at the same time. You can then save it and reference them at a later date.
These days most of my scripts are built from copying and pasting from my old scripts as I have usually covered most stuff at one point. AutoIT as already mentioned is a great language as well. I tend to use this mostly for those really awkward software installations that you can't do another way. I also use it when I want a standalone exe.
If you're interested in learning vbscript, may I recommend this book: "Managing Windows with VBScript and WMI" by Don Jones (ISBN 0-321-21334-3). There may be newer editions out by now, but I write vbscripts all of the time, and I still find myself referring back to that book. Microsoft's Script Center is a pretty good online resource and their "Scriptomatic" tool will help you dig into the bowels of WMI when you're trying to figure out how to script something that you can't find a good example on.