Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #RequireAdmin
- #include <AutoItConstants.au3>
- #cs ----------------------------------------------------------------------------
- Get VAR from CMD:
- wmic diskdrive get Caption, DeviceID, InterfaceType
- #ce ----------------------------------------------------------------------------
- $sMyDiskDrive = '\\.\PHYSICALDRIVE6'
- MsgBox( 0 , '' , _PFSshell( $sMyDiskDrive , 'ls' ))
- #cs ----------------------------------------------------------------------------
- Comment the line above & uncomment the lines below to get a better example
- Edit OPLpart & POPpart to your prefered size
- !!!!!!!!!! WARNING THIS WILL NUKE EVERYTHING ON THE DRIVE !!!!!!!!!!
- #ce ----------------------------------------------------------------------------
- ;$sNukeHdd = 'initialize yes'
- ;$sOPLpart = 'mkpart +OPL 12G'
- ;$sOPLfolders = 'mount +OPL|mkdir APPS|mkdir ART|mkdir CFG|mkdir CHT|mkdir DVD|mkdir LNG|mkdir POPS|mkdir THM|mkdir VMC|umount'
- ;$sPOPfolders = 'mount __common|mkdir POPS|umount'
- ;$sPOPpart = 'mkpart __.POPS 40G'
- ;_PFSshell( $sMyDiskDrive , $sNukeHdd )
- ;_PFSshell( $sMyDiskDrive , $sOPLpart )
- ;_PFSshell( $sMyDiskDrive , $sOPLfolders )
- ;_PFSshell( $sMyDiskDrive , $sPOPfolders )
- ;_PFSshell( $sMyDiskDrive , $sPOPpart )
- ;MsgBox( 0 , '' , _PFSshell( $sMyDiskDrive , 'ls -l' ))
- #cs ----------------------------------------------------------------------------
- Executes a STRING of commands using PFSshell upon a PS2 HDD
- Returns STRING log of executed commands.
- Requires
- #RequireAdmin
- #include <AutoItConstants.au3>
- #ce ----------------------------------------------------------------------------
- Func _PFSshell( $sDiskDrive , $sCommands , $sPFSshellAppPath = @ScriptDir & '\Bin\PFS Shell\' )
- Local $iPID = Run( @ComSpec & ' /C pfsshell' , $sPFSshellAppPath , @SW_HIDE , $STDIN_CHILD + $STDOUT_CHILD )
- ProcessWait( 'pfsshell.exe' )
- StdinWrite( $iPID , 'device ' & $sDiskDrive & @CRLF )
- Local $aCommands = StringSplit( $sCommands , '|' )
- For $ii = 1 To $aCommands[0]
- StdinWrite( $iPID , $aCommands[$ii] & @CRLF )
- Next
- StdinWrite( $iPID , 'exit' & @CRLF )
- ProcessWaitClose( 'pfsshell.exe' )
- ProcessClose( $iPID )
- Local $sPID = StdoutRead( $iPID )
- ; Strip the First 11 lines
- $sPID = StringTrimLeft( $sPID , StringInStr( $sPID , @CRLF , 0 , 11 ) + 1 )
- Return $sPID
- EndFunc
Add Comment
Please, Sign In to add comment