diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 396b70a..2100729 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + + diff --git a/PropertiesDotNet.Designer.vb b/PropertiesDotNet.Designer.vb index c6fdc09..00e9c19 100644 --- a/PropertiesDotNet.Designer.vb +++ b/PropertiesDotNet.Designer.vb @@ -622,6 +622,7 @@ Partial Class PropertiesDotNet 'btnClose ' Me.btnClose.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles) + Me.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel Me.btnClose.Location = New System.Drawing.Point(330, 19) Me.btnClose.Name = "btnClose" Me.btnClose.Size = New System.Drawing.Size(75, 23) @@ -669,6 +670,7 @@ Partial Class PropertiesDotNet ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6!, 13!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnClose Me.ClientSize = New System.Drawing.Size(416, 505) Me.Controls.Add(Me.grpEditID) Me.Controls.Add(Me.grpChangeable) diff --git a/PropertiesDotNet.vb b/PropertiesDotNet.vb index 69937ce..2cfbd65 100644 --- a/PropertiesDotNet.vb +++ b/PropertiesDotNet.vb @@ -121,7 +121,7 @@ Public Class PropertiesDotNet End Sub Sub btnOpenWith_Click() Handles btnOpenWith.Click Dim isDangerousExtension As New Boolean - Dim dangerousExtensions() As String = {".exe", ".bat", ".cmd", ".lnk", ".com"} + Dim dangerousExtensions() As String = {".exe", ".bat", ".cmd", ".lnk", ".com", ".scr"} For i = 1 To dangerousExtensions.Length If lblExtension.Text = dangerousExtensions(i-1) Then isDangerousExtension = True @@ -261,7 +261,7 @@ Public Class PropertiesDotNet If newName <> "" Then Try FileProperties.MoveTo(FileProperties.DirectoryName & "\" & newName) - lblLocation.Text = FileProperties.DirectoryName & "\" & newName + lblLocation.Text = FileProperties.FullName Catch ex As exception If ex.GetType.ToString = "System.UnauthorizedAccessException" Then If MsgBox(ex.message & vbnewline & vbnewline & "Try launching a system tool as admin?", _ @@ -317,19 +317,20 @@ Public Class PropertiesDotNet Sub btnCopy_MouseUp(sender As Object, e As MouseEventArgs) Handles btnCopy.MouseUp If e.Button = Windows.Forms.MouseButtons.Right Then Dim FileProperties As New FileInfo(lblLocation.Text) - Dim newName = InputBox("Copy to:", "Copy file", FileProperties.Name) + Dim newName = InputBox("Copy to:", "Copy file", FileProperties.FullName) If newName <> "" Then Try FileProperties.CopyTo(newName) - lblLocation.Text = newName + If MsgBox("Read new file?", MsgBoxStyle.YesNo + MsgBoxStyle.Question) = MsgBoxResult.Yes Then _ + lblLocation.Text = newName Catch ex As exception If ex.GetType.ToString = "System.UnauthorizedAccessException" Then If MsgBox(ex.message & vbnewline & vbnewline & "Try launching a system tool as admin?", _ - MsgBoxStyle.YesNo + MsgBoxStyle.Exclamation, "Access denied!") = MsgBoxResult.Yes Then + MsgBoxStyle.YesNo + MsgBoxStyle.Exclamation, "Access denied!") = MsgBoxResult.Yes Then CreateObject("Shell.Application").ShellExecute("xcopy", """" & lblFullPath.Text & _ - """ """ & newName & """", "", "runas") + """ """ & newName & """", "", "runas") If MsgBox("Read new file?", MsgBoxStyle.YesNo + MsgBoxStyle.Question) = MsgBoxResult.Yes Then _ - lblLocation.Text = newName + lblLocation.Text = newName Else ErrorParser(ex) End If