Jump to content

Assing Letters to Volumes in a different way


careca
 Share

Recommended Posts

Hi guys, this is a small gui to change a volume letter, press button to list the volumes, then choose the volume that you want to change the letter, write the volume number in the input box, and write the letter you want the volume to change to...press change, it'll change the letter. This uses the cmd tool, i wasn't able to incorporate all this into autoit due to my poor skills, maybe one of you experts can help on that kind of improvement.

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=Resources\Terminal.ico
#AutoIt3Wrapper_Res_Icon_Add=Resources\Terminal.ico
#AutoIt3Wrapper_Run_Tidy=y
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Local $Change, $List, $Vol1, $Vol2, $Vol3, $Vol4, $mylist, $exec
$Form1 = GUICreate("Volume Letter", 292, 70, 190, 125)
GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
$Vol1 = GUICtrlCreateInput("", 104, 8, 57, 21)
$Label1 = GUICtrlCreateLabel("Volume to change", 8, 8, 91, 17)
$Exit = GUICtrlCreateButton("Exit", 184, 34, 75, 25)
GUICtrlSetOnEvent($Exit, "Close")
$Change = GUICtrlCreateButton("Change to", 96, 34, 75, 25)
GUICtrlSetOnEvent($Change, "Change")
$List = GUICtrlCreateButton("List Drives", 8, 34, 75, 25)
GUICtrlSetOnEvent($List, "List")
$Label2 = GUICtrlCreateLabel("Set to:", 176, 8, 35, 17)
$Vol2 = GUICtrlCreateInput("", 216, 8, 57, 21)
GUISetState(@SW_SHOW)
Func Close()
 ProcessClose("diskpart.exe")
 _WinAPI_Beep(3500, 200)
 Exit
EndFunc   ;==>Close
Func List()
 _WinAPI_Beep(1500, 200)
 ShellExecute("C:\Windows\System32\diskpart.exe")
 WinWait("C:\Windows\System32\diskpart.exe")
 WinActivate("C:\Windows\System32\diskpart.exe")
 Sleep(100)
 Send("list volume")
 Sleep(100)
 Send("{ENTER}")
EndFunc   ;==>List
Func Change()
 _WinAPI_Beep(2500, 200)
 $Vol3 = GUICtrlRead($Vol1, 1)
 WinActivate("[CLASS:ConsoleWindowClass]")
 Sleep(500)
 Send("select volume " & $Vol3)
 Sleep(500)
 Send("{ENTER}")
 Sleep(100)
 $Vol4 = GUICtrlRead($Vol2, 1)
 WinActivate("[CLASS:ConsoleWindowClass]")
 Sleep(500)
 Send("assign letter=" & $Vol4)
 Sleep(100)
 Send("{ENTER}")
 Sleep(1000)
 Send("list volume")
 Sleep(100)
 Send("{ENTER}")
EndFunc   ;==>Change
While 1
 $Msg = GUIGetMsg()
 Switch $Msg
  Case $GUI_EVENT_CLOSE
   Exit
 EndSwitch
WEnd
Edited by careca
Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Ur welcome, JScript.

Yeah, AZJIO, i can see that in the first post script,

one can choose the volume and letter to change to.

It seems a good way of doing the assign part of my script, are you sugesting

it would be a better way instead of writing to the cmd window?

Im gonna try to improve my script on that direction.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

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...