Jump to content
Sign in to follow this  
besihad

ShellExecute parameters problem - dosn't work

Recommended Posts

besihad

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

Share this post


Link to post
Share on other sites
KaFu

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)

Share this post


Link to post
Share on other sites
besihad

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.

Share this post


Link to post
Share on other sites
KaFu

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)

Share this post


Link to post
Share on other sites
besihad

Very Thanks KAFU, problem solved.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×