Jump to content

Recommended Posts

Posted (edited)

hi, i am from Turkey,

i want to start an access mdb file with runtime. but my code dosn't work. Parameter of ShellExecute command not adaptable with my directoy path. (there is Turkish characters and Space " " in my path)

My codes:

$Uygulama = "deneme.mdb"
$UygulamaYolu = @ScriptDir & "\" & $Uygulama
MsgBox(4096, "Bilgi:", @ScriptDir)
;MsgBox(4096, "Bilgi:", $UygulamaYolu)
$KuruluDizin = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Access\InstallRoot", "Path")
$Access = $KuruluDizin & "MSACCESS.EXE"
;MsgBox(4096, "Bilgi:", $Access)

;MsgBox(4096, "Bilgi:", $Access & " " & $UygulamaYolu)

$baslat = ShellExecute($Access, $UygulamaYolu & " /Runtime") ;here is my error
;MsgBox(4096, "Bilgi:", $baslat)

Thanks.

Edited by besihad
Posted

Normally the trick with shellexecute is, that you don't need the path of the application but windows starts the file with the default associated application. Try something like this:

$Uygulama = "deneme.mdb"
$UygulamaYolu = @ScriptDir & "\" & $Uygulama
MsgBox(4096, "Bilgi:", @ScriptDir)

#cs
;MsgBox(4096, "Bilgi:", $UygulamaYolu)
$KuruluDizin = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Access\InstallRoot", "Path")
$Access = $KuruluDizin & "MSACCESS.EXE"
;MsgBox(4096, "Bilgi:", $Access)
;MsgBox(4096, "Bilgi:", $Access & " " & $UygulamaYolu)
#ce
$baslat = ShellExecute($UygulamaYolu,"/Runtime",@ScriptDir,"open")
;$baslat = ShellExecute($Access, $UygulamaYolu & " /Runtime") ;here is my error
;MsgBox(4096, "Bilgi:", $baslat)
Posted

Hi, very thanks to your answer.But,

this code don't run Access Runtime mode. İt is worked normal mode. /Runtime parameter didn't used by shellexecute.

Posted

Hadnt't Access at hand >_<... maybe this?

$Uygulama = "deneme.mdb"
$UygulamaYolu = @ScriptDir & "\" & $Uygulama
;MsgBox(4096, "Bilgi:", @ScriptDir)
;MsgBox(4096, "Bilgi:", $UygulamaYolu)
$KuruluDizin = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Access\InstallRoot", "Path")
$Access = $KuruluDizin & "MSACCESS.EXE"
;MsgBox(4096, "Bilgi:", $Access)
;MsgBox(4096, "Bilgi:", $Access & " " & $UygulamaYolu)
Run(FileGetShortName($Access) & " " & FileGetShortName($UygulamaYolu) & " /Runtime",@ScriptDir)
;$baslat = ShellExecute($UygulamaYolu,"",@ScriptDir, "")
;$baslat = ShellExecute($Access, $UygulamaYolu & " /Runtime") ;here is my error
;MsgBox(4096, "Bilgi:", $baslat)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...