Archive: Shell a command In dos with Nsis In 64Bit System


Shell a command In dos with Nsis In 64Bit System
hi
How Shell A command in Dos With Nsis?!

this codes not Work:



Exec 'bcdedit /set {current} safeboot Minimal'

nsExes::Exec 'bcdedit /set {current} safeboot Minimal'


ExecCmd::exec 'bcdedit /set {current} safeboot Minimal'

ExecDos::exec 'bcdedit /set {current} safeboot Minimal'



?

Nobody here can not help me?


it's the weekend and so replies (if any are going to come) are not likely until the normal working week starts + it can take a few days to get a reply at times (am only replying to say that, i've no idea about your actual question).


Originally posted by r2du-soft
Nobody here can not help me?
You don't provide any useful information so how do you expect to get help?

How does it fail? Error messages?

tanks Guys
when start nsis program whit this codes:

Exec '"bcdedit" /set {current} safeboot Minimal'
Exec '"bcdedit.exe" /set {current} safeboot Minimal'
Exec 'cmd.exe /k "bcdedit" /set {current} safeboot Minimal'
Exec 'cmd.exe /k "bcdedit.exe" /set {current} safeboot Minimal'



cmd Show This Error:
http://upload7.ir/images/44640093689033879671.jpg

i Think "Exec" Not Work In Windows 64 Bit! , But Can used Replace Another source code to Exec The Work This Program? or Fix Exec Code?!

tanks


Use the full path to bcdedit?


yes i test this:

Exec '"c:\windows\system32\bcdedit" /set {current} safeboot Minimal'
Exec '"c:\windows\system32\bcdedit.exe" /set {current} safeboot Minimal'
Exec 'cmd.exe /k "c:\windows\system32\bcdedit" /set {current} safeboot Minimal'
Exec 'cmd.exe /k "c:\windows\system32\bcdedit.exe" /set {current} safeboot Minimal'

but not work


Try $windir\sysnative\bcdedit.exe


Originally posted by Anders
Try $windir\sysnative\bcdedit.exe
This Not Worked
But I Find A way For Worked! But this is not consistent!!
If Copy 'bcdedit.exe' from "C:\Windows\System32" To "C:\' and used this code:

Exec 'CMD.exe /k "c:\bcdedit.exe" /set {current} safeboot Minimal'

then Program Worked!
i think Because the patch file bcdedit.exe is long (C:\windows\system32) The program could not find the file.

Also i test this code for Short path:

Exec 'CMD.exe /k "$SYSDIR\bcdedit.exe" /set {current} safeboot Minimal'

But Cmd Say

"

http://upload7.ir/images/41308754608529501729.jpg


"

Is there a way to fix this problem؟؟؟؟

Filesystem redirection is getting in the way, you probably need a 64bit helper application that calls bcdedit for you...


Originally posted by Anders
Filesystem redirection is getting in the way, you probably need a 64bit helper application that calls bcdedit for you...
How do it?

:cry: :cry: :cry: :cry: :cry: :cry: :cry:

This Codes Not Work on Windows 64 Bit

CopyFiles $Sysdir\bcdedit.exe $Windir
CopyFiles $Sysdir\bcdedit.exe C:\
CopyFiles C:\Windows\System32\bcdedit.exe C:\


:cry: :cry: :cry: :cry: :cry: :cry: :cry:

When Start Program:
Copy Failed


yeeeeeeeeee
I Can Fix THIS!!!!!!


!include "x64.nsh"

Section
${DisableX64FSRedirection}
Exec '"bcdedit" /set {current} safeboot Minimal'
Sectionend


Tanks guys

That is not really a good solution because dll loading can fail when you disable the redirection. At least turn the redirection back on after the Exec...


Originally posted by Anders
That is not really a good solution because dll loading can fail when you disable the redirection. At least turn the redirection back on after the Exec...
Yes
When Finished Work ,Also Can Again Enabled , When are Done , Whit code:

${EnableX64FSRedirection}