Skip to content
⌘ NSIS Forum Archive

Shell a command In dos with Nsis In 64Bit System

15 posts

r2du-soft#

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'

?
DrO#
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).
Anders#
Originally Posted by r2du-soft View Post
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?
r2du-soft#
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:


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
r2du-soft#
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
r2du-soft#
Originally Posted by Anders View Post
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

"




"

Is there a way to fix this problem؟؟؟؟
Anders#
Filesystem redirection is getting in the way, you probably need a 64bit helper application that calls bcdedit for you...
r2du-soft#
Originally Posted by Anders View Post
Filesystem redirection is getting in the way, you probably need a 64bit helper application that calls bcdedit for you...
How do it?
r2du-soft#
😢 😢 😢 😢 😢 😢 😢

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:\


😢 😢 😢 😢 😢 😢 😢

When Start Program:
Copy Failed
r2du-soft#edited
yeeeeeeeeee
I Can Fix THIS!!!!!!


!include "x64.nsh"

Section
${DisableX64FSRedirection}
Exec '"bcdedit" /set {current} safeboot Minimal'
Sectionend
Tanks guys
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...
r2du-soft#
Originally Posted by Anders View Post
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}