无法在WINDOWS 7中运行批量文件 [英] CANNOT RUN BATCH FILE IN WINDOWS 7

查看:75
本文介绍了无法在WINDOWS 7中运行批量文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



我有批处理文件xyz.bat包含这些命令

copy msvcrtd.dll c:\\

复制MSFLXGRID.OCX c:\\

复制ActiveBrowse.ocx c:\\

regsvr32 c:\\ MSFLXGRID.OCX

regsvr32 c:\\ActiveBrowse.ocx



这个批处理文件在xp中工作正常,但我遇到了问题

1.每当我运行批处理文件时,所有文件都出现访问被拒绝错误,未注册activex控件。

2.每当我运行批处理文件时运行为 管理员privelege,找不到文件错误显示在命令提示符下。







任何人都可以解决我的问题

Hello

I am having batch file xyz.bat containing these commands
copy msvcrtd.dll c:\\
copy MSFLXGRID.OCX c:\\
copy ActiveBrowse.ocx c:\\
regsvr32 c:\\MSFLXGRID.OCX
regsvr32 c:\\ActiveBrowse.ocx

this batch file works fine in xp but i am facing problems
1. whenever i run batch file, error "Access is denied" for all files, activex controls are not registered.
2. whenever i run batch file with "run as" administrator privelege, file is not found error is shown at command prompt.



can anybody solve my problem

推荐答案

你需要以管理员身份运行它。仅拥有管理员权限是不够的,您还应该使用提升权限运行它。具体如下:

http://www.sevenforums.com/tutorials/ 11841-run-administrator.html [ ^ ]。



这不仅与批处理有关,而且与所有应用程序以及可能需要提升权限的所有操作有关。请参阅:

http://en.wikipedia.org/wiki/User_Account_Control [< a href =http://en.wikipedia.org/wiki/User_Account_Controltarget =_ blanktitle =New Window> ^ ]。



实际上,你根本不应该对系统磁盘的根目录这样做(如果C:是你的系统磁盘,可能不是这种情况)。这不是放置应用程序内容的合法目录。什么是合法目录,取决于您的目标。请参阅系统文档。无论如何,如果您需要创建一些不需要UAC确认的目录,请在安全选项卡下创建一些目录并执行其属性的必需管理。但是当然这个政府本身也需要提升特权。



另一种选择是关闭UAC,但我会强烈反对这样做。







你得到找不到档案只是因为它是未找到。你真的了解路径名和命令语法吗?请检查一下。



-SA
You need to run it "As Administrator". Just having an administrator's privileges is not enough, you also should run it with "elevated privileges". This is how:
http://www.sevenforums.com/tutorials/11841-run-administrator.html[^].

This is related not just to the batch, but to all applications and everything you do which may require privilege elevation. Please see:
http://en.wikipedia.org/wiki/User_Account_Control[^].

In fact, you simply should not do such thing with the root directory of a system disk (if "C:" is your system disk, which may be not the case). This is not a legal directory for putting your application stuff. What is legal directory, depends on your goal. Refer to system documentation. Anyway, if you need to create some directory which would not need UAC confirmation, create some directory and perform required administration of its properties, under "Security" tab. But this administration will itself require elevation of the privileges, of course.

Another option is to switch UAC off, but I would strongly discourage doing so.



And you got "file is not found" simply because it's not found. Do you really understand path names and command syntax? Just check it up.

—SA


至于找不到文件错误,这个可能是因为Windows 7没有与Windows XP相同的文件(出乎意料!),或者至少可能将其中一些文件移到了不同​​的地方。我检查了我的W7系统,发现:



- msvcrtd.dll根本不在我的系统上,但msvcrt.dll可以在15个不同的位置找到,其中大多数彼此不同

- msflxgrd.ocx位于目录C:\ Windows \ SysWOW64 \中。注意,这不是包含msvcrt.dll的目录之一

- ActiveBrowse.ocx根本不在我的系统上!



随便你试图完成,你最好阅读你在Windows 7中需要的系统文件,当你在它的时候,阅读如何正确调用它们 - 复制系统文件通常不是一个好主意。他们是他们出于某种原因的地方。
As for the file not found error, this is probably due to the fact that Windows 7 does not have the same files as Windows XP (surprise!) , or at least may have moved some of them to different places. I checked on my W7 system and found:

- msvcrtd.dll is not on my system at all, but msvcrt.dll can be found in 15 different locations, with most of them different from each other
- msflxgrd.ocx is located in the directory C:\Windows\SysWOW64\ . Note, this is not one of the directories containing msvcrt.dll
- ActiveBrowse.ocx is not on my system at all!

Whatever you tried to accomplish, you better read up on what system files you need in Windows 7, and while you're at it, read up on how to properly invoke them - copying system files is generally not a good idea. They are where they are for a reason.


实际上,我遇到了同样的问题,我在那个代码上写了一个.BAT文件就像那样写了

// IN XP

cd \

cd程序文件

cd ipmsg

ipmsg.exe / MSG 172.16 .11.100 Abc消息...



您需要更改目标文件的路径,

您可能会看到正确的路径通过右键单击文件并查看属性,

这里你将是正确的路径,因此你改变了路径,它必须工作。



我相应改变了路径

//在WINDOWS 7

cd \

cd程序文件(x86)

cd ipmsg

ipmsg.exe / MSG 172.16.11.100 Abc消息......
Actully, I was facing the same problem, I was using a .BAT file on that code written like that
// IN XP
cd\
cd Program Files
cd ipmsg
ipmsg.exe /MSG 172.16.11.100 Abc Message...

You need to change the path of the targeted file,
you may see the correct path for the file by right click and see the property,
here you will the right path, accordingly you changed the path, it must work.

I changed the path accordingly
// IN WINDOWS 7
cd\
cd Program Files (x86)
cd ipmsg
ipmsg.exe /MSG 172.16.11.100 Abc Message...


这篇关于无法在WINDOWS 7中运行批量文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆