哪位兄弟碰到过这种情况的呢?
我调用api
Declare Function GetWindowsDirectory Lib "kernel32 " Alias "GetWindowsDirectoryA " (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Function WindowsDirectory() As String
Dim WinPath As String
WinPath = String(145, Chr(0))
WindowsDirectory = Left(WinPath, GetWindowsDirectory(WinPath, Len(WinPath)))
End Function
在本机正常
在客户服务器上得到的WindowsDirectory()=C:\Documents and Settings\Administrator\windows
而且如果我删除的了windows目录,运行程序后还会自动生成!!
太怪了,客户用的是win2000 server sp4。
[解决办法]
http://support.microsoft.com/kb/924066/zh-cn
[解决办法]
忽然想到个问题,系统Windows目录是在配置文件里设置的,也就是用户有可能会更改这个配置,把windows目录改成别的,设置办法如下:
我的电脑-属性-高级-环境变量-系统变量-windir
看看你不好用服务器上这个设置的目录是什么,如果不对,改成正常,应该就OK了。
═══════════════════
http://www.egooglet.com 资料、源码下载
http://bbs.j2soft.cn 论坛交流
═══════════════════