Jump to content

complex issue in dos


boy15
 Share

Recommended Posts

  • Moderators
1 hour ago, boy15 said:

I hit autoiscript

No idea what this is supposed to mean, care to elaborate?

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • 3 weeks later...
#RequireAdmin
#include <AutoItConstants.au3>
#include <WinAPI.au3>

$a_DDriveLetter = DriveGetDrive($DT_REMOVABLE)
For $i = 1 To UBound($a_DDriveLetter) - 1
   $letter = StringReplace(StringUpper($a_DDriveLetter[$i]),":","")
$handle =   FileOpen("script-drive-"&$letter&".txt",2)
    FileWrite($handle,"select volume " &$letter & @CRLF & _
                                             "clean" & @CRLF & _
                                             "create part pri"  & @CRLF & _
                                             "select part 1"  & @CRLF & _
                                             "format fs=ntfs quick"  & @CRLF & _
                                             "active"  & @CRLF & _
                                             "exit" & @CRLF)
 FileClose($handle)
$confirm = MsgBox(0x4,"Confirm","Are you sure you want to make bootable device at letter 
 "&$letter,0,_WinAPI_GetForegroundWindow())
if $confirm = 6 Then 
$pid = Run(@ComSpec & " /C diskpart /s script-drive-"&$letter&".txt",@ScriptDir,@SW_SHOW,0x10000)
ProcessWaitClose($pid)
FileClose($handle)
FileDelete("script-drive-"&$letter&".txt")
endif
Next

But I do not know what is wrong in the  break line

$confirm = MsgBox(0x4,"Confirm","Are you sure you want to make bootable device at letter
 "&$letter,0,_WinAPI_GetForegroundWindow())

Link to comment
Share on other sites

https://www.autoitscript.com/autoit3/files/beta/autoit/docs/intro/lang_comments.htm

Maybe the second sentence on the page will help you understand.  If not, maybe the first example will help you understand.

Link to comment
Share on other sites

4 minutes ago, boy15 said:

Do you try it ?

@boy15

I don't need to try it.  I see the problem. 

I pointed to you to the reason why it isn't working, in the Help file.  I also pointed you to an example in the Help file that should show you how to do what you are trying to do. 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...