Old 14th December 2009, 12:13   #1
ChocJunkie
Senior Member
 
Join Date: Oct 2009
Location: Germany
Posts: 120
Execute diskpart

Hi,

I'm trying to execute the 'diskpart' command during installation. I've tryed using ExecWait, nsExec::exec, ExecDos::exec and ExecCmd::exec but it seems I'm doing something wrong, because the command never succeeds.
code:
ExecWait '"diskpart" /s $\"C:\Documents and Settings\Administrator\Desktop\test.txt$\"'
${If} ${Errors}
...
${EndIf}


What am I doing wrong? >.<

Thanks.

CJ
ChocJunkie is offline   Reply With Quote
Old 14th December 2009, 13:00   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Diskpart is an executable, not a command. Try supplying a full path to the exe file.
MSG is offline   Reply With Quote
Old 14th December 2009, 13:20   #3
ChocJunkie
Senior Member
 
Join Date: Oct 2009
Location: Germany
Posts: 120
I've tried calling the program directly from path C:\WINNT\system32\diskpart.exe. Nothing has changed - the command fails.
Thanks anyway, MSG.

That can't be normal, because what are the Exec commands and plugins for if it is not possible to call a executable!?

If anyone wants to test it: You can use a empty file so that your system stays healthy.

[ADDED]

I forgot to say, I can execute
code:
ExecCmd::exec "wmic ... "
successfully. I just kind of don't get whats the big difference!?

Last edited by ChocJunkie; 14th December 2009 at 13:42.
ChocJunkie is offline   Reply With Quote
Old 14th December 2009, 13:46   #4
CG!
Junior Member
 
CG!'s Avatar
 
Join Date: Nov 2009
Location: Germany
Posts: 48
Re: Execute diskpart

Try
ExecWait "cmd /c %windir%\system32\diskpart /s %userprofile%\Desktop\test.txt"
Maybe this helps.

Religion must die, for mankind to live.
©Religulous:Bill Maher:2008
CG! is offline   Reply With Quote
Old 14th December 2009, 13:57   #5
ChocJunkie
Senior Member
 
Join Date: Oct 2009
Location: Germany
Posts: 120
Thanks, but it doesn't help.
ChocJunkie is offline   Reply With Quote
Old 14th December 2009, 15:34   #6
ChocJunkie
Senior Member
 
Join Date: Oct 2009
Location: Germany
Posts: 120
Sorry, I'm not realy into the "System" plug-in right now, but is it possible to execute the command using the plug-in?
ChocJunkie is offline   Reply With Quote
Old 14th December 2009, 16:41   #7
ChocJunkie
Senior Member
 
Join Date: Oct 2009
Location: Germany
Posts: 120
Ok, I've tried calling "diskpart" from inside a batch file.
I've I'm executing the batch manualy, everything works correct. When I'm calling the batch using my installer, I get a error message that's ... not nice.
Quote:
'diskpart' is not recognized as an internal or external command, operable program or batch file.
Return code: 9009
Any idea for a workaround?

Thanks.

CJ
ChocJunkie is offline   Reply With Quote
Old 14th December 2009, 16:46   #8
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 462
diskpart.exe

The exec commands you are using are not adding an extension and cannot find the file without it.
demiller9 is offline   Reply With Quote
Old 15th December 2009, 07:57   #9
ChocJunkie
Senior Member
 
Join Date: Oct 2009
Location: Germany
Posts: 120
I simply don't get it ... I've tried the exec functions from different plug-ins, I've tried calling 'diskpart', 'diskpart.exe', 'C:\WINNT\system32\diskpart.exe' and I've tried executing the command by calling it through a batch file.

Does someone know why I can call 'wmic' using ExecCmd::exec but can't call 'diskpart'?!

The problem is, I realy need this functionality. >.<
ChocJunkie is offline   Reply With Quote
Old 15th December 2009, 09:05   #10
ChocJunkie
Senior Member
 
Join Date: Oct 2009
Location: Germany
Posts: 120
Ok, sorry for all the trouble. The problem has been found. On normal windows the installer works fine, but I've used it on a special windows version.

Thanks for all help!

CJ
ChocJunkie is offline   Reply With Quote
Old 5th January 2010, 14:12   #11
ChocJunkie
Senior Member
 
Join Date: Oct 2009
Location: Germany
Posts: 120
Ok, even when using x64.nsh calling diskpart.exe fails.
It's neither mine nor NSIS' fault - Micrsoft itself is causing the proplem.
Even if looking for exactly C:\windows\system32\diskpart.exe Windows is redirecting the call will to C:\windows\sysWoW64\diskpart.exe. Because that file is missing, the call fails.

Further information: http://www.itnewsgroups.net/group/mi...topic8160.aspx

Greetings,
CJ
ChocJunkie is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump