?
Solved

Simple Batch file not working

Posted on 2009-07-16
8
Medium Priority
?
314 Views
Last Modified: 2012-05-07
All,

      My kung-fu with regards to scripting is weak. That said I am pretty sure that the code below should work.

In brief it should go like this:

The batch file creates a directory and then copies files to it using xcopy /E (don't know why, but 'copy' doesn't do it.).  At the end of the batch file I run 'regedit /s source.reg'.

The problem is that the registry changes are not taking place.

In closing, I would like to mention that I have read the following:
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Q_22672135.html#a19408970 --> VB Script DOES NOT WORK
http://www.tweakxp.com/article37514.aspx --> I know where/what reg keys need to be altered ... so this is a mute point.

The code and images are attached.

Please help.

Thank you,

Naerwen
===BATCH FILE===
 
REM This batch file will copy the I386 folder to the "C:\I386" folder and enter the proper registry entries
REM to eliminate the need to have a Windows XP Disk when installing/uninstalling Windows components.
 
REM Create destination directory
mkdir C:\I386
 
REM Get I386 to the root of 'C'
xcopy I386 c:\I386 /E
 
REM Next we will merge the necessary registry entries to point to 'C:\I386' 
 
regedit /s source.reg
 
pause
 
 
===source.reg FILE===
 
Windows Registry Editor Version 5.00
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup]
"ServicePackSourcePath"="C:\"
"SourcePath"="C:\"

Open in new window

batchfileimages.png
0
Comment
Question by:Naerwen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 5

Expert Comment

by:ti84p
ID: 24872304
try removing the /s from the regedit command and see if it returns an error
0
 
LVL 5

Expert Comment

by:ti84p
ID: 24872317
it is possible that the user doesn't have the necessary permissions
0
 
LVL 1

Author Comment

by:Naerwen
ID: 24872614
ti84p,
 
     Thank you for the prompt response. I should have been more thorough when explaining the test environment:
1) Removing the '/s' simply does what it is supposed to do, which is prompt the user to say 'OK' or 'Cancel'.
2) To address your second concern, the test platform is a Dell D630 using the local Administrator account. To take that a step further the only other piece of software installed on the box is Snagit9 and Office 2003.
 
I hope this helps your assessment. I will remain engaged while working this problem.
 
Thank you,
 
Naerwen
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 21

Accepted Solution

by:
AmazingTech earned 2000 total points
ID: 24873618
To get the correct reg file. Export so you have what it looks like.


Windows Registry Editor Version 5.00
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup]
"ServicePackSourcePath"="C:\\"
"SourcePath"="C:\\"

Open in new window

0
 
LVL 5

Expert Comment

by:ti84p
ID: 24873719
Does removing /s make it import properly though?
0
 
LVL 21

Expert Comment

by:AmazingTech
ID: 24873752
Remove the /s for testing. Once everything looks OK. Put the /s in.

But in your case I don't think you need to be testing anymore.
0
 
LVL 1

Author Closing Comment

by:Naerwen
ID: 31604353
AmazingTech,

Perfect. My export of the tree WAS INCORRECT for some reason ... or I may have edited and forgotten.

Thank you,

Naerwen
0
 
LVL 21

Expert Comment

by:AmazingTech
ID: 24878870
Always export so you can get the baseline of what it should look like.

I'm glad it works for you now.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month13 days, 6 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question