Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Execute diskpart (http://forums.winamp.com/showthread.php?t=315341)

ChocJunkie 14th December 2009 11:13

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

MSG 14th December 2009 12:00

Diskpart is an executable, not a command. Try supplying a full path to the exe file.

ChocJunkie 14th December 2009 12:20

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!?

CG! 14th December 2009 12:46

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

ChocJunkie 14th December 2009 12:57

Thanks, but it doesn't help. :(

ChocJunkie 14th December 2009 14:34

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 14th December 2009 15:41

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

demiller9 14th December 2009 15:46

diskpart.exe

The exec commands you are using are not adding an extension and cannot find the file without it.

ChocJunkie 15th December 2009 06:57

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 15th December 2009 08:05

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 5th January 2010 13:12

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


All times are GMT. The time now is 18:05.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.