.bat file execution problem (windows 7)

Asked By 10 points N/A Posted on -
qa-featured

I have a batch file which copy some file to a certain directory.

It work on windows XP fine

but when i try to do it on windows 7 it is not working.

Is there any changes of a copy command in windows 7?

 

SHARE
Best Answer by Trevor
Best Answer
Best Answer
Answered By 0 points N/A #113998

.bat file execution problem (windows 7)

qa-featured

Batch files problem executing in Microsoft Windows 7

As far as I know, batch file scripting in Microsoft Windows 7 is the same with the previous version of windows unless if you are using external commands in your batch file program.

Although there are some changes in internal commands in Microsoft Windows 7, still the old command and parameters are still there.

Maybe you can also check all commands used in your batch file program. Check all the external commands use in your batch file program and check the existence of the command in windows 7. If it is already not available in windows 7 try typing HELP on the command prompt plus the subject matter.

For example you want the information for the command CLS. Just type on the command prompt HELP CLS then press enter. This will show you the current parameters and commands for CLS internal command including the syntax.

Bye the way, try to run your batch file program under the shell of COMMAND.COM. I am pretty sure that this command interpreter always bearing the old way of internal commands.

You have mentioned that the function of your batch file program is to transfer or copy files from the folder to another folder. Microsoft Windows 7 is too heavy in restriction. You must check the source and the destination folder if the current user where the batch file executed has the access on those folders.

If it is accessible by the current user your source and destination folder, is that folder or the destination folder is accessible for writing?

If it is not, change the security and allow the current user a permission to write on that folder.

Another solution is run your batch file as Administrator; right click in your batch file program then select Run as Administrator in the pop-up menu. Or, run the CMD.EXE or COMMAND.COM as Administrator then under that shell run your batch file program.

Answered By 0 points N/A #113999

.bat file execution problem (windows 7)

qa-featured

It happens mostly with the batch (.bat) files that require administrative rights to get executed.

So, it gives you a feel like there is something wrong in your .bat file. But actually it is not.

You simply need to assign administrative privileges to your .bat file. To do so, you have to run your file as administrator.

Solution is, click on Start Menu – find Command Prompt icon – right click on it – find “Run as Administrator” and click this option. That’s it.

Hope it solves your problem.

Related Questions