Find the problem with my batch file

weasel2htm

Limp Gawd
Joined
Sep 8, 2004
Messages
332
Mods, If this is the wrong place for this, move it and send me a PM

I have looked at this a gajillion times, I can't find what is wrong, I need another set of eyes to look at it.

This is to copy some of the office 07 shortcuts to the desktop on windows 7.
I have tried running and "Run as Administrator" Still don't work.

Code:
copy "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Microsoft Office Word 2007.lnk" "C:\Users\Public\Desktop\Microsoft Office Word 2007.lnk"
copy "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Microsoft Office Excel 2007.lnk" "C:\Users\Public\Desktop\Microsoft Office Excel 2007.lnk"
copy "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Microsoft Office PowerPoint 2007.lnk" "C:\Users\Public\Desktop\Microsoft Office PowerPoint 2007.lnk"
copy "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Microsoft Office Publisher 2007.lnk" "C:\Users\Public\Desktop\Microsoft Office Publisher 2007.lnk"
 
There are no problems with your batch file. Look at file permissions.

Also -- open a command prompt as administrator and manually run your batch file and see what your error says. It'll close if you just launch it, so you need to launch it from a command prompt so you can see the output before it close...

That, or put a pause in there like this:

Code:
copy "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Microsoft Office Word 2007.lnk" "C:\Users\Public\Desktop\Microsoft Office Word 2007.lnk"
Pause

copy "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Microsoft Office Excel 2007.lnk" "C:\Users\Public\Desktop\Microsoft Office Excel 2007.lnk"

Pause

copy "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Microsoft Office PowerPoint 2007.lnk" "C:\Users\Public\Desktop\Microsoft Office PowerPoint 2007.lnk"
Pause


copy "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Microsoft Office Publisher 2007.lnk" "C:\Users\Public\Desktop\Microsoft Office Publisher 2007.lnk"
Pause
 
Well I finally got back to this, I keep getting an "Access is Denied" error on each step, yet I am logged in with administrative rights. I guess Microsoft didn't get all the vista fail ironed out of win 7. Windows 7 or vista do not seem to like batch files.

This is supposed to take two seconds to copy the office 7 shortcuts and be easier than doing the manual copy, This M$ crap is defeating the purpose.
 
I don't think I'd be too quick to blame this one on Microsoft. I ran your batch file on my Win7x64 machine and it worked without problems.
 
Problem just dawned on me, I had to copy off the network drive to the local hard disk drive and then "Run As Administrator" It's won't run directly off the network drive (never a issue in XP)
doh.gif
So that is all it is, thanks for the help, it wasn't until after I read the last post when the potential issue with running from a network drive popped into my head.
 
One word: Powershell.

The copy-item command is a lot more robust than the CMD copy command.
 
Back
Top