Windows Thread, Need help with batch files please! in Technical; Hi All,
I am currently working in a secondary school in Birmingham. I want to learn how to create batch ...
-
10th June 2010, 09:12 PM #1
- Rep Power
- 0
Need help with batch files please!
Hi All,
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:
Reg Key Location:
[HKEY_CURRENT_USER\SOFTWARE\XMIND]
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,
Richard Mills
Last edited by richrad_mills; 10th June 2010 at 09:15 PM.
-
-
IDG Tech News
-
10th June 2010, 09:16 PM #2 If it was me I was use Autoit:
AutoIt v3 - Automate and Script Windows Tasks - For Free!
or batch wise - the Reg command. Just google 'reg command'
http://www.robvanderwoude.com/
Is a good place to start [ if you are a newbie to all this ]
Or:
http://www.kixtart.org/
Which is what I started out in donkey years ago.....
Last edited by mattx; 10th June 2010 at 09:18 PM.
-
Thanks to mattx from:
richrad_mills (10th June 2010)
-
10th June 2010, 09:20 PM #3
- Rep Power
- 0
Thanks Mattx for the advice I really appreciate it.
I also wanted to know how I would write the bacth file for this problem. I like learning things like this, I am willing to learn.
Thanks once again,
Richard Mills
Last edited by richrad_mills; 10th June 2010 at 09:27 PM.
-
-
10th June 2010, 09:25 PM #4
-
Thanks to mattx from:
richrad_mills (10th June 2010)
-
10th June 2010, 09:29 PM #5
- Rep Power
- 0
Thanks Again Mattx,
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.
Thanks
Richard Mills
-
-
10th June 2010, 09:35 PM #6 One more of my fav sites which may come in handy for you:
Dx21
-
-
11th June 2010, 12:37 AM #7 Another useful resource I have found is the Batch Function Library on the commandline.co.uk website, especially if you need to work with dates and time in your batch files.
-
-
11th June 2010, 12:47 AM #8 To answer your original question, this is how I would modify that value in a batch file.
Code:
@echo off
REG ADD HKCU\Software\XMind /v Path /t REG_SZ /d "\"C:\Documents and Settings\All Users\Documents\XMind"\" /f
Some other good examples for the Reg command can be found here.
Last edited by Arthur; 11th June 2010 at 08:47 AM.
-
Thanks to Arthur from:
richrad_mills (11th June 2010)
-
11th June 2010, 02:33 PM #9
- Rep Power
- 0

Originally Posted by
Arthur
To answer your original question, this is how I would modify that value in a batch file.
Thanks Arthur I really appreciate it.
Thanks again,
Richard Mills
Last edited by ChrisH; 14th June 2010 at 07:05 PM.
-
-
14th June 2010, 02:08 PM #10
- Rep Power
- 10
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:
Code:
; Custom ADM template for XMind.
;
; Created by Brian Henry.
; www.zooofthenew.com
CLASS USER
CATEGORY "XMind"
POLICY "XMind Options"
EXPLAIN !!PolicyDescription
KEYNAME "Software\Xind"
PART "File location where the temp files will be saved:" EDITTEXT REQUIRED EXPANDABLETEXT DEFAULT "C:\Program Files\XMind"
VALUENAME "Path"
END PART
END POLICY
END CATEGORY
[strings]
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.
-
-
14th June 2010, 06:30 PM #11 
Originally Posted by
BBrian
You can also change registry settings using Group Policy Preferences.
For making changes to the registry, Group Policy Preferences seems to be a better choice compared to creating an ADM/ADMX file.
-
-
14th June 2010, 08:06 PM #12 I use this a lot to get the different commands I want: SS64.com Command line reference. does well for me!
-
-
14th June 2010, 08:15 PM #13 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.
-
-
23rd June 2010, 07:24 PM #14
- Rep Power
- 0
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.
-
SHARE:
Similar Threads
-
By Aaron in forum Windows Server 2008
Replies: 6
Last Post: 1st February 2010, 04:18 PM
-
By Kyle in forum How do you do....it?
Replies: 10
Last Post: 19th November 2009, 07:31 AM
-
Replies: 4
Last Post: 13th November 2008, 12:25 PM
-
By Kained in forum Windows Vista
Replies: 6
Last Post: 4th September 2007, 02:25 PM
-
By russdev in forum Windows
Replies: 4
Last Post: 19th November 2005, 10:51 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules