We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
Batch File - What Am I Doing Wrong [SOLVED]
Options

Oblivion
Posts: 20,248 Forumite


Hope someone can help with this because it is driving me crazy.
Windows 7 Ultimate. I have a program called Access Manager which stores all my passwords. The program has always had a little bug where occasionally it won't open reporting 'border limits out of bound' or something like that.
Apparently it's because the .cfg file gets corrupted. The solution is to simply overwrite the AccessManager.cfg file with an older version and all is well again until the next time.
Anyway, instead of having to copy and paste this .cfg file manually, I thought I'd write a little batch file with a shortcut on the desktop but I can't get it to work. Have I got the syntax wrong or done something else stupid?
Filename: Access Manager Recovery.cmd (I've also tried running it as a .bat) located in C:\
The old version of AccessManager.cfg is also in C:\
Batch file wording:
Copy AccessManager.cfg C:\Users\Dave\AppData\Local\Citi-Software\Access Manager 2\AccessManager.cfg
REM When Access Manager fails to open reporting 'Out of boundary limits', run this
REM batch file to copy a good old copy of AccessManager.cfg over the corrupted one.
I've checked that I've got the paths correct, and I've tried running it as Administrator but still no joy.
Windows 7 Ultimate. I have a program called Access Manager which stores all my passwords. The program has always had a little bug where occasionally it won't open reporting 'border limits out of bound' or something like that.
Apparently it's because the .cfg file gets corrupted. The solution is to simply overwrite the AccessManager.cfg file with an older version and all is well again until the next time.
Anyway, instead of having to copy and paste this .cfg file manually, I thought I'd write a little batch file with a shortcut on the desktop but I can't get it to work. Have I got the syntax wrong or done something else stupid?
Filename: Access Manager Recovery.cmd (I've also tried running it as a .bat) located in C:\
The old version of AccessManager.cfg is also in C:\
Batch file wording:
Copy AccessManager.cfg C:\Users\Dave\AppData\Local\Citi-Software\Access Manager 2\AccessManager.cfg
REM When Access Manager fails to open reporting 'Out of boundary limits', run this
REM batch file to copy a good old copy of AccessManager.cfg over the corrupted one.
I've checked that I've got the paths correct, and I've tried running it as Administrator but still no joy.
... Dave
Happily retired and enjoying my 14th year of leisure
I am cleverly disguised as a responsible adult.
Bring me sunshine in your smile
0
Comments
-
It's probably because of the spaces in the file path. Try adding quotes:
Copy AccessManager.cfg "C:\Users\Dave\AppData\Local\Citi-Software\Access Manager 2\AccessManager.cfg"
Also because the the file already exists, you will get a prompt asking if you want to overwrite it. You can force this with no prompt by using the /y switch - https://technet.microsoft.com/en-gb/library/bb490886.aspx?f=255&MSPPError=-2147217396Copy /y AccessManager.cfg "C:\Users\Dave\AppData\Local\Citi-Software\Access Manager 2\AccessManager.cfg"
0 -
The spaces in the destination file path might be the cause of the problem. Try putting quotation marks around the destination file path, thus:
Copy AccessManager.cfg "C:\Users\Dave\AppData\Local\Citi-Software\Access Manager 2\AccessManager.cfg"
Edit: mr_fishbulb had already posted by the time my post appeared.0 -
Thanks guys, that worked a treat ... I knew it had to be something simple. :beer:... DaveHappily retired and enjoying my 14th year of leisureI am cleverly disguised as a responsible adult.Bring me sunshine in your smile0
-
mr_fishbulb wrote: »Also because the the file already exists, you will get a prompt asking if you want to overwrite it. You can force this with no prompt by using the /y switch
Interestingly it didn't need the /Y switch ... it just ran and all I saw was a very brief glimpse of the Command window but no prompts at all. Not an issue of course and I'm so relieved it's finally working as I intended. Thanks again for your help. :T... DaveHappily retired and enjoying my 14th year of leisureI am cleverly disguised as a responsible adult.Bring me sunshine in your smile0 -
Interestingly it didn't need the /Y switch ... it just ran and all I saw was a very brief glimpse of the Command window but no prompts at all. Not an issue of course and I'm so relieved it's finally working as I intended. Thanks again for your help. :T
I was re-reading my link and it looks like if you use copy in a batch file, it automatically overwrites.
0 -
If you wanted it to start the program as well you could add the following line:-
start "" ***
*** - you'll need the path and any switches from the original program shortcut to go in here.
That way, the batch file will replace the config file and run the program at the same time.:wall: Flagellation, necrophilia and bestiality - Am I flogging a dead horse? :wall:
Any posts are my opinion and only that. Please read at your own risk.0
This discussion has been closed.
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 350.8K Banking & Borrowing
- 253K Reduce Debt & Boost Income
- 453.4K Spending & Discounts
- 243.7K Work, Benefits & Business
- 598.5K Mortgages, Homes & Bills
- 176.8K Life & Family
- 256.9K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.6K Read-Only Boards