如shell "d:\postnew\up.exe",vbnormalfocus
那么如何设定把up.exe的工作路径呢,我在 系统的环境变量里的path里添加了,没用,有没有api函数可以用以设定工作路径呢????????????????

解决方案 »

  1.   

    dim mypath as string
    shell mypath & "up.exe",vbnormalfocus
    dim mypath为变量,你可以将相应的路径放入到变量中。
      

  2.   

    to  chenyu5188(来自东方的狼) 
    我说的不是这个意思,我说的就有点象 一个快捷方式里的起始位置:
        快捷方式的目标:d:\postnew\up.exe
        那起始位置:                  如何设定呢因为 shell的可执行文件是按照 起始位置 来调用和寻找dll的 。
      

  3.   

    你可以用api
    SetCurrentDirectorySetCurrentDirectory VB声明 
    Declare Function SetCurrentDirectory Lib "kernel32" Alias "SetCurrentDirectoryA" (ByVal lpPathName As String) As Long 
    说明 
    设置当前目录 
    返回值 
    Long,非零表示成功,零表示失败。会设置GetLastError 
    参数表 
    参数 类型及说明 
    lpPathName String,新当前目录的路径