小弟的电脑上装有双操作系统,我的问题是:
怎样用 VB 程序获得当前正在使用的 windows 系统被安装在哪个文件夹下
C:\windows\ 还是 D:\windows\ ?
怎样用 VB 程序获得当前正在使用的 windows 系统被安装在哪个文件夹下
C:\windows\ 还是 D:\windows\ ?
解决方案 »
- 将vb软件改为vb.net软件,难不难?改写的过程、方法、语句等应注意哪些不同,谁能提供改写的方法和步骤。我的vb软件有62个过程函数,有23
- 大家帮忙!我想做一个用摄相头拍照的软件,请问哪里有摄相头控件下啊?
- MSCOMM的oncomm事件一次只接收8个字节!!求助啊!
- 判断远程服务器上的.txt文件存在(在线等)
- 怎样用VB提交表单(尤其是需要先登录的网站)?
- server端ocx和cab,值得讨论
- vb 6 c/s 网络数据库开发教程
- 如何通过程序来控制comobox的下拉?(续之二)
- sql语句中的替换函数是啥?格式?????具体问题具体分析
- 有关运行程序进程判断的问题,急!急!急!
- 如何查看vb项目中一个文件的路径?
- 打印问题.
sysdir = string(vbnullchar,256)
getsystemdirectory sysdir,256
S = String(256, " ")
GetWindowsDirectory S, 256
MsgBox "Windows装在" & Left(S, 1) & "盘"
S = String(256, " ")
GetWindowsDirectory S, 256
MsgBox "Windows装在" & Left(S, 1) & "盘"
Private Sub Command1_Click()
GetSystemDirectoryA
End Sub想实现点击按钮 Command1 就弹出
MsgBox "Windows装在" & Left(S, 1) & "盘"
可是运行时却提示 S = String(256, " ") 出错 “编译错误:无效外部过程”
恳请大侠再指点一下。
set windir=所以标准方法是用GetWindowsDirectory
至于那个问题,可能是由于VBA库出错。将String()改成VBA.String$()
S = String(256, " ")
GetWindowsDirectory S, 256
MsgBox "Windows装在" & Left(S, 1) & "盘"
Private Sub Command1_Click()
GetSystemDirectoryA
End Sub这段代码是在哪里的呀?应该是这样:Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As LongPrivate Sub Command1_Click() Dim S As String
S = String(256, " ")
GetWindowsDirectory S, 256
MsgBox "Windows装在" & Left(S, 1) & "盘"End Sub