Notes ACCESS 2022 | Browsers | Css | Htacess | Html | Html5 | Javascript | Microsoft Excel | Mysql | Mysql Dumps | Php | Vb.net | VBscript | Windows <=8 | Windows >=10 | WP | WP Plugin | WP Themes | _Misc Software | ABCDEFGHIJKLMNOPQRSTUVWXYZONPRTOFF codeid operationid title keywords application code languageid show_html show_iframe make_public viewed viewed_date language operation <- Look Inside DataConditions:Order: 1|2|3|4|5|6|7|8|50 Language Operation Title Keywords Application Code Languageid Show Html Show Iframe Make Public Viewed Viewed Date Vb.net Database Creating A Databse Driven Drop Down combo mdb drop down list access developer Module ConnDB() in Using The Datagridview Control Private Sub LoadMultipleCombo() Try sqL = "SELECT [replaceid],[title],[section_code] FROM [mulitreplace] order by [title]" ConnDB() cmd = New OleDbCommand(sqL, conn) 'dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) Catch ex As Exception MsgBox(ex.Message) End Try Dim Table_ As String = "mulitreplace ORDER BY title" Dim ds As New DataSet Dim da As New OleDbDataAdapter(cmd) da.Fill(ds, Table_) conn.Close() Dim t1 As DataTable = ds.Tables(Table_) txMultiAction.Items.Clear() txMultiAction.ValueMember = "replaceid" txMultiAction.DisplayMember = "title" txMultiAction.DataSource = ds.Tables(Table_) End Sub Function LoadMultiData() ConnDB() Dim Table_ As String = "mulitreplace WHERE replaceid=" + Str(txMultiAction.SelectedValue) Dim query As String = "SELECT * FROM " & Table_ Dim ds As New DataSet Dim cmd As New OleDbCommand(query, conn) Dim da As New OleDbDataAdapter(cmd) da.Fill(ds, Table_) conn.Close() Dim t1 As DataTable = ds.Tables(Table_) Dim row As DataRow Dim Item(2) As String For Each row In t1.Rows Item(0) = row(0) Item(1) = row(1) Item(2) = row(2) Next Return Item(2) End Function Vb.net 2 02/06/2025 Vb.net Database Inserting Records Into Database And Data Grid add insert update sql Web Tools Create & Update Records Imports System.IO Imports System.Text Imports System.Data.OleDb Private Sub btAdd_Click(sender As Object, e As EventArgs) Handles btAdd.Click Select Case table_selected Case "copytext" Try sqL = "INSERT INTO [copy_it]([category],[copy_text],[notes]) VALUES ('" + txTitle.Text + "', '" + TXfield3.Text + "', '" + txSectionCode.Text + "')" ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) Catch ex As Exception MsgBox(ex.Message) End Try DataGridView1.Rows.Add(0, txTitle.Text, TXfield3.Text, txSectionCode.Text) Case "directorycopy" Try sqL = "INSERT INTO [directory_copy]([prefix],[directory]) VALUES ('" + txTitle.Text + "', '" + txSectionCode.Text + "')" ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) Catch ex As Exception MsgBox(ex.Message) End Try DataGridView1.Rows.Add(0, txTitle.Text, txSectionCode.Text) Case "multireplace" Try sqL = "INSERT INTO [mulitreplace]([title],[section_code]) VALUES ('" + txTitle.Text + "', '" + txSectionCode.Text + "')" ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) Catch ex As Exception MsgBox(ex.Message) End Try DataGridView1.Rows.Add(0, txTitle.Text, txSectionCode.Text) Case "filepaths" Try sqL = "INSERT INTO [file_paths]([file_path],[computer]) VALUES ('" + txSectionCode.Text + "','" + My.Computer.Name + "')" ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) Catch ex As Exception MsgBox(ex.Message) End Try DataGridView1.Rows.Add(0, txSectionCode.Text) Case "emailmoved" Try sqL = "INSERT INTO [move_email]([move_to],[archive],[subject_filter]) VALUES ('" + txTitle.Text + "', '" + TXfield3.Text + "', '" + txSectionCode.Text + "')" ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) Catch ex As Exception MsgBox(ex.Message) End Try DataGridView1.Rows.Add(0, txTitle.Text, txSectionCode.Text, TXfield3.Text) Case "emailfiltered" Try sqL = "INSERT INTO [Filtered_email]([importance],[email]) VALUES ('" + txTitle.Text + "', '" + txSectionCode.Text + "')" ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) Catch ex As Exception MsgBox(ex.Message) End Try DataGridView1.Rows.Add(0, txSectionCode.Text, txTitle.Text) End Select Private Sub btUpdate_Click(sender As Object, e As EventArgs) Handles btUpdate.Click Dim update As DataGridViewRow = DataGridView1.SelectedRows(0) If txReplaceid.Text = "0" Then MsgBox("You cannot edit new records without refresh.") : Exit Sub Select Case table_selected Case "copytext" update.Cells(1).Value = txTitle.Text update.Cells(2).Value = TXfield3.Text update.Cells(3).Value = txSectionCode.Text Try sqL = "UPDATE [copy_it] SET [category]='" + txTitle.Text + "',[copy_text]='" + TXfield3.Text + "',[notes]='" + txSectionCode.Text + "' WHERE [copyID]=" + txReplaceid.Text ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) Catch ex As Exception MsgBox(ex.Message) End Try Case "multireplace" update.Cells(1).Value = txTitle.Text update.Cells(2).Value = txSectionCode.Text Try sqL = "UPDATE [mulitreplace] SET [title]='" + txTitle.Text + "',[section_code]='" + txSectionCode.Text + "' WHERE [replaceid]=" + txReplaceid.Text ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) Catch ex As Exception MsgBox(ex.Message) End Try Case "directorycopy" update.Cells(1).Value = txTitle.Text update.Cells(2).Value = txSectionCode.Text Try sqL = "UPDATE [directory_copy] SET [prefix]='" + txTitle.Text + "',[directory]='" + txSectionCode.Text + "' WHERE [directoryID]=" + txReplaceid.Text ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) Catch ex As Exception MsgBox(ex.Message) End Try Case "filepaths" update.Cells(1).Value = txSectionCode.Text Try sqL = "UPDATE [file_paths] SET [file_path]='" + txSectionCode.Text + "' WHERE [pathID]=" + txReplaceid.Text ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) Catch ex As Exception MsgBox(ex.Message) End Try Case "emailfiltered" update.Cells(2).Value = txTitle.Text update.Cells(1).Value = txSectionCode.Text Try sqL = "UPDATE [Filtered_email] SET [importance]='" + txTitle.Text + "',[email]='" + txSectionCode.Text + "' WHERE [emailID]=" + txReplaceid.Text ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) Catch ex As Exception MsgBox(ex.Message) End Try Case "emailmoved" update.Cells(1).Value = txTitle.Text update.Cells(3).Value = TXfield3.Text update.Cells(2).Value = txSectionCode.Text Try sqL = "UPDATE [move_email] SET [move_to]='" + txTitle.Text + "',[archive]='" + TXfield3.Text + "',[subject_filter]='" + txSectionCode.Text + "' WHERE [moveID]=" + txReplaceid.Text ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) Catch ex As Exception MsgBox(ex.Message) End Try End Select Vb.net 2 07/23/2025 Vb.net Database Loading Records From Database Into Data Grid data grid datagrid Web Tools Load Grid With Mdb Imports System.IO Imports System.Text Imports System.Data.OleDb Private Sub btRefresh_Click(sender As Object, e As EventArgs) Handles btRefresh.Click txReplaceid.Text = "" : txTitle.Text = "" : txSectionCode.Text = "" : DataGridView1.Columns.Clear() Select Case table_selected Case "copytext" txSectionCode.Height = 100 : TXfield3.Visible = True : txTitle.Visible = True With DataGridView1 .SelectionMode = DataGridViewSelectionMode.FullRowSelect .Width = 1150 .Columns.Add("copyID", "copyID") : .Columns.Add("category", "category") : .Columns.Add("copy_text", "copy_text") : .Columns.Add("notes", "notes") .Columns(0).Visible = False .Columns(1).HeaderText = "Category" : .Columns(1).Width = 120 .Columns(2).HeaderText = "TEXT" : .Columns(2).Width = 420 .Columns(3).HeaderText = "Notes" : .Columns(3).Width = 200 Try sqL = "SELECT [copyID],[category],[copy_text],[notes] FROM [copy_it] ORDER BY [category],[copy_text]" ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) .Rows.Clear() Do While dr.Read .Rows.Add(dr(0), dr(1), dr(2), dr(3)) Loop Catch ex As Exception MsgBox(ex.Message) End Try End With Case "filepaths" txSectionCode.Height = 100 : TXfield3.Visible = False With DataGridView1 .SelectionMode = DataGridViewSelectionMode.FullRowSelect .Width = 1150 .Columns.Add("pathID", "pathID") : .Columns.Add("file_path", "file_path") .Columns(0).Visible = False : txTitle.Visible = False .Columns(1).HeaderText = "File Path" .Columns(1).Width = 1200 Try sqL = "SELECT [pathID],[file_path] FROM [file_paths] WHERE [computer]='" + My.Computer.Name + "' ORDER BY [file_path]" ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) .Rows.Clear() Do While dr.Read .Rows.Add(dr(0), dr(1)) Loop Catch ex As Exception MsgBox(ex.Message) End Try End With Case "multireplace" txSectionCode.Height = 300 : TXfield3.Visible = False With DataGridView1 .SelectionMode = DataGridViewSelectionMode.FullRowSelect .Width = 1150 .Columns.Add("switchid", "switchid") : .Columns.Add("position", "Position") : .Columns.Add("code", "code") : .Columns.Add("Description", "Description") .Columns(0).Visible = False : txTitle.Visible = True .Columns(1).HeaderText = "Title" .Columns(2).HeaderText = "Code" .Columns(1).Width = 300 : .Columns(2).Width = 1200 Try sqL = "SELECT [replaceid],[title],[section_code] FROM [mulitreplace] order by [title]" ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) .Rows.Clear() Do While dr.Read .Rows.Add(dr(0), dr(1), dr(2)) Loop Catch ex As Exception MsgBox(ex.Message) End Try End With Case "directorycopy" txSectionCode.Height = 300 : TXfield3.Visible = False With DataGridView1 .SelectionMode = DataGridViewSelectionMode.FullRowSelect .Width = 1150 .Columns.Add("directorid", "DirectoryID") : .Columns.Add("prefix", "Prefix") : .Columns.Add("directory", "Directory") ' .Columns.Add("Description", "Description") .Columns(0).Visible = False : txTitle.Visible = True .Columns(1).HeaderText = "Prefix" .Columns(2).HeaderText = "Directory" .Columns(1).Width = 300 : .Columns(2).Width = 1200 Try sqL = "SELECT [directoryID],[prefix],[directory] FROM [directory_copy] order by [prefix]" ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) .Rows.Clear() Do While dr.Read .Rows.Add(dr(0), dr(1), dr(2)) Loop Catch ex As Exception MsgBox(ex.Message) End Try End With Case "emailfiltered" txSectionCode.Height = 100 : TXfield3.Visible = False With DataGridView1 .SelectionMode = DataGridViewSelectionMode.FullRowSelect .Width = 1150 .Columns.Add("emailID", "ID") : .Columns.Add("email", "Email Filter") : .Columns.Add("importance", "Rate") ' .Columns.Add("Description", "Description") .Columns(0).Visible = False : txTitle.Visible = True .Columns(1).HeaderText = "Email Filter" .Columns(2).HeaderText = "Rated" .Columns(1).Width = 400 : .Columns(2).Width = 100 Try sqL = "SELECT [emailID],[email],[importance] FROM [Filtered_email] ORDER BY [email]" ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) .Rows.Clear() Do While dr.Read .Rows.Add(dr(0), dr(1), dr(2)) Loop Catch ex As Exception MsgBox(ex.Message) End Try End With Case "emailmoved" txSectionCode.Height = 100 : TXfield3.Visible = True : txTitle.Visible = True With DataGridView1 .SelectionMode = DataGridViewSelectionMode.FullRowSelect .Width = 1150 .Columns.Add("moveID", "ID") : .Columns.Add("move_to", "Move To") : .Columns.Add("subject_filter", "Subject Phrase") : .Columns.Add("archive", "Archive") .Columns(0).Visible = False .Columns(1).HeaderText = "Move To" : .Columns(1).Width = 250 .Columns(2).HeaderText = "Subject Phrase" : .Columns(2).Width = 600 .Columns(3).HeaderText = "Archive" : .Columns(3).Width = 200 Try sqL = "SELECT [moveID],[move_to],[subject_filter],[archive] FROM [move_email] ORDER BY [move_to],[subject_filter]" ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) .Rows.Clear() Do While dr.Read .Rows.Add(dr(0), dr(1), dr(2), dr(3)) Loop Catch ex As Exception MsgBox(ex.Message) End Try End With End Select End Sub =============== mouse event ============== Private Sub DataGridView1_MouseClick(sender As Object, e As MouseEventArgs) Handles DataGridView1.MouseClick Dim dr As DataGridViewRow = DataGridView1.SelectedRows(0) Select Case table_selected Case "copytext" Try txReplaceid.Text = dr.Cells(0).Value.ToString() txTitle.Text = dr.Cells(1).Value.ToString() TXfield3.Text = dr.Cells(2).Value.ToString() Clipboard.SetText(TXfield3.Text, TextDataFormat.UnicodeText) txSectionCode.Text = dr.Cells(3).Value.ToString() Catch ex As Exception MsgBox(Err.ToString) End Try Case "directorycopy" Try txReplaceid.Text = dr.Cells(0).Value.ToString() txTitle.Text = dr.Cells(1).Value.ToString() txSectionCode.Text = dr.Cells(2).Value.ToString() Catch ex As Exception MsgBox(Err.ToString) End Try Case "multireplace" Try txReplaceid.Text = dr.Cells(0).Value.ToString() txTitle.Text = dr.Cells(1).Value.ToString() txSectionCode.Text = dr.Cells(2).Value.ToString() Catch ex As Exception MsgBox(Err.ToString) End Try Case "filepaths" Try txReplaceid.Text = dr.Cells(0).Value.ToString() txSectionCode.Text = dr.Cells(1).Value.ToString() Catch ex As Exception MsgBox(Err.ToString) End Try Case "emailmoved" Try txReplaceid.Text = dr.Cells(0).Value.ToString() txTitle.Text = dr.Cells(1).Value.ToString() TXfield3.Text = dr.Cells(3).Value.ToString() txSectionCode.Text = dr.Cells(2).Value.ToString() Catch ex As Exception MsgBox(Err.ToString) End Try Case "emailfiltered" Try txReplaceid.Text = dr.Cells(0).Value.ToString() txSectionCode.Text = dr.Cells(1).Value.ToString() Catch ex As Exception MsgBox(Err.ToString) End Try End Select End Sub Vb.net 4 09/08/2025 Vb.net Database ConnectionMod.vb add update sql access radio Web Tools Database Imports System.Data.OleDb Module ModConnection Public cur As Form Public dt As DataTable Public conn As OleDbConnection Public cmd As OleDbCommand Public dr As OleDbDataReader Public da As OleDbDataAdapter Public ds As DataSet Public sqL As String Public Sub ConnDB() Dim R As String = My.Computer.Name ' R = GetIni("Database", R, INI) If R = "" Then WriteIni("Database", My.Computer.Name, "Dropboxvb10fileExplorerfileExplorerbinReleasePHPCreator.mdb", INI) Shell("write.exe " + INI, vbNormalFocus) : Exit Sub End If 'C:UserssteveDropboxvb10fileExplorerfileExplorerbinReleasePHPCreator.mdb" Try Dim connectionString As String = "Provider=Microsoft.jet.oledb.4.0;Data Source=" + R 'Dim connectionString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + R conn = New OleDbConnection(connectionString) 'conn = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath() & "beer.mdb;") 'conn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Databasephone.mdb;Jet OLEDB:Database Password = escobar;") conn.Open() Catch ex As Exception MsgBox("Failed in Connecting to database") End Try End Sub Public Function getDataTable(ByVal SQL As String) As DataTable ConnDB() Dim cmd As New OleDbCommand(SQL, conn) Dim dt As New DataTable Dim da As New OleDbDataAdapter(cmd) da.Fill(dt) Return dt End Function End Module -------------- radio button test ------------------------- Private Sub rbFilePaths_CheckedChanged(sender As Object, e As EventArgs) Handles rbFilePaths.CheckedChanged If rbFilePaths.Checked = True Then table_selected = "filepaths" : btRefresh_Click(sender, e) End Sub Private Sub rbMultireplace_CheckedChanged(sender As Object, e As EventArgs) Handles rbMultireplace.CheckedChanged If rbMultireplace.Checked = True Then table_selected = "multireplace" : btRefresh_Click(sender, e) End Sub Private Sub txText_TextChanged(sender As Object, e As EventArgs) Handles txText.TextChanged End Sub Private Sub rbDirectoryCopy_CheckedChanged(sender As Object, e As EventArgs) Handles rbDirectoryCopy.CheckedChanged If rbDirectoryCopy.Checked = True Then table_selected = "directorycopy" : btRefresh_Click(sender, e) End Sub Private Sub RBcopyText_CheckedChanged(sender As Object, e As EventArgs) Handles RBcopyText.CheckedChanged If RBcopyText.Checked = True Then table_selected = "copytext" : btRefresh_Click(sender, e) End Sub Private Sub RBemailFiltered_CheckedChanged(sender As Object, e As EventArgs) Handles RBemailFiltered.CheckedChanged If RBemailFiltered.Checked = True Then table_selected = "emailfiltered" : btRefresh_Click(sender, e) End Sub Private Sub RBemailMove_CheckedChanged(sender As Object, e As EventArgs) Handles RBemailMove.CheckedChanged If RBemailMove.Checked = True Then table_selected = "emailmoved" : btRefresh_Click(sender, e) End Sub ====== selected table ============= Select Case table_selected Case "copytext" Case "directorycopy" Case "multireplace" Case "filepaths" Case "emailmoved" Case "emailfiltered" End Select Vb.net 5 07/23/2025 Vb.net Files Directory Files Into A List Box Checking Drive Available delete files directory drive listbox Imports System.IO [DELETE FILE] If File.Exists(TREE3 + FLD(0, 0) + "_header.php") Then File.Delete(TREE3 + FLD(0, 0) + "_header.php") ============== Function DriveAvailable(driveLetter As String) As Boolean Try Dim driveInfo As New DriveInfo(driveLetter) Return driveInfo.IsReady ' Returns True if the drive is ready Catch ex As Exception Return False ' Return False if an exception occurs (e.g., invalid drive) End Try End Function Sub LoadFilesListBox(ByRef coBox As ListBox, ByVal folderPath As String, ByVal Pattern As String) Dim M0 As Integer = 1, fileName1 As String = "", M1 As Integer, M As Integer 'PatternSection As String 'Dim di As New IO.DirectoryInfo(folderPath), diar1 As IO.FileInfo(), dra As IO.FileInfo With coBox .Items.Clear() End With Dim AllowedExtension As String = "*.*" If Not System.IO.Directory.Exists(folderPath) Then MsgBox("This folder seems to have disappeared.") : Exit Sub For Each file As String In IO.Directory.GetFiles(folderPath, "*.*") M1 = file.LastIndexOf("") + 1 : M = file.Length - M1 fileName1 = file.Substring(M1, M) coBox.Items.Add(fileName1) Next End Sub Vb.net 2 09/09/2023 Vb.net Files Read And Write ENTIRE FILE open read file write file entire File Writing [READ] read entire file into string. A = My.Computer.FileSystem.ReadAllText(Path.TREE2 + "/" + Explore.File1.Items(J).ToString, System.Text.Encoding.Default) CODE1 = My.Computer.FileSystem.ReadAllText(Tree2 + Filename + "Code.txx") [WRITE] Dim CODE1 As String = My.Computer.FileSystem.ReadAllText(Tree2 + Filename + "Code.txx") J = InStr(CODE1, "``") : CODE1 = Left(CODE1, J - 1) For J = 0 To TMPA.Count - 1 If InStr(CODE1, "`" + TMPA(J) + "`") = 0 Then NotFound = True : CODE1 = CODE1 + "`" + TMPA(J) + "`" + vbCR Next CODE1 = CODE1 + "``" + vbCR If NotFound = True Then My.Computer.FileSystem.WriteAllText(Tree2 + Filename + "Code.txx", CODE1, append:=False) Vb.net 1290 09/09/2023 Vb.net Files Read Text File Line By Line & Write read file line write append Imports Microsoft.VisualBasic Module Module1 Sub Main() Dim filePath As String = "example.txt" Dim fileNumber As Integer = FreeFile() Try ' Open file for append using legacy VB method FileOpen(fileNumber, filePath, OpenMode.Append) 'FileOpen(7, TREE3 + FLD(0, 0) + "_header.php", OpenMode.Output) PrintLine(fileNumber, "This is a new line of text.") Catch ex As Exception Console.WriteLine("Error: " & ex.Message) Finally FileClose(fileNumber) End Try End Sub End Module READ LINES FROM A TEXT FILE Dim LineInput As System.IO.StreamReader = My.Computer.FileSystem.OpenTextFileReader(Tree + "tabletempsave.txt") Do Until LineInput.EndOfStream A = LineInput.ReadLine : A = Trim(A) LOOP lineInput.close ========================================= Shared Sub Main() ' Get an available file number. Dim file_num As Integer = FreeFile() ' Open the file. Dim file_name As String = "test.txt" FileOpen(file_num, file_name, OpenMode.Input, OpenAccess.Read, OpenShare.Shared) ' Read the file's lines. Do While Not EOF(file_num) ' Read a line. Dim txt As String = LineInput(file_num) Console.WriteLine(txt) Loop ' Close the file. FileClose(file_num) End Sub Vb.net 1352 09/09/2023 Vb.net Files Strip Html From Text strip html strip tags browser If you get html text from a browser you can read the clipboard as html Imports System.Text.RegularExpressions Module Module1 Sub Main() ' Input. Dim html As String = "There was a .NET programmer " + "and he stripped the HTML tags." ' Call Function. Dim tagless As String = StripTags(html) ' Write. Console.WriteLine(tagless) End Sub ''' ''' Strip HTML tags. ''' Function StripTags(ByVal html As String) As String ' Remove HTML tags. Return Regex.Replace(html, "<.*?>", "") End Function End Module Vb.net 1009 09/09/2023 Vb.net Files Create A Copy Or Move A File In A Different Directory copy files move files File Management ' Copy the file to a new location without overwriting existing file. My.Computer.FileSystem.CopyFile( "C:UserFilesTestFilestestFile.txt", "C:UserFilesTestFiles2testFile.txt") ' Copy the file to a new folder, overwriting existing file. My.Computer.FileSystem.CopyFile( "C:UserFilesTestFilestestFile.txt", "C:UserFilesTestFiles2testFile.txt", Microsoft.VisualBasic.FileIO.UIOption.AllDialogs, Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing) ' Copy the file to a new folder and rename it. My.Computer.FileSystem.CopyFile( "C:UserFilesTestFilestestFile.txt", "C:UserFilesTestFiles2NewFile.txt", Microsoft.VisualBasic.FileIO.UIOption.AllDialogs, Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing) ================== overwrite defaults to false need to add ",true" inside the function The My.Computer.FileSystem.MoveFile method can be used to move a file to another folder. If the target structure does not exist, it will be created. To move a file Use the MoveFile method to move the file, specifying the file name and location for both the source file and the target file. This example moves the file named test.txt from TestDir1 to TestDir2. Note that the target file name is specified even though it is the same as the source file name. VB Copy My.Computer.FileSystem.MoveFile("C:TestDir1test.txt", "C:TestDir2test.txt") To move a file and rename it Use the MoveFile method to move the file, specifying the source file name and location, the target location, and the new name at the target location. This example moves the file named test.txt from TestDir1 to TestDir2 and renames it nexttest.txt. VB Copy My.Computer.FileSystem.MoveFile("C:TestDir1test.txt", "C:TestDir2nexttest.txt", FileIO.UIOption.AllDialogs, FileIO.UICancelOption.ThrowException) Vb.net 0 12/10/2023 Vb.net Files FILE MODIFICATION file date newer File Copy Private Const GENERIC_READ = &H80000000 Private Const GENERIC_WRITE = &H40000000 Private Const FILE_SHARE_READ = &H1 Private Const FILE_SHARE_WRITE = &H2 Private Const CREATE_NEW = 1 Private Const CREATE_ALWAYS = 2 Private Type FILETIME dwLowDateTime As Long dwHighDateTime As Long End Type Private Type SYSTEMTIME wYear As Integer wMonth As Integer wDayOfWeek As Integer wDay As Integer wHour As Integer wMinute As Integer wSecond As Integer wMilliseconds As Integer End Type Private Type TIME_ZONE_INFORMATION Bias As Long StandardName(31) As Integer StandardDate As SYSTEMTIME StandardBias As Long DaylightName(31) As Integer DaylightDate As SYSTEMTIME DaylightBias As Long End Type Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" ( _ ByVal lpFileName As String, ByVal dwDesiredAccess As Long, _ ByVal dwShareMode As Long, ByVal lpSecurityAttributes As Long, _ ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, _ ByVal hTemplateFile As Long) As Long Private Declare Function CloseHandle Lib "kernel32.dll" ( _ ByVal hObject As Long) As Long Private Declare Function FileTimeToSystemTime Lib "kernel32" (lpFileTime As _ FILETIME, lpSystemTime As SYSTEMTIME) As Long Private Declare Function FileTimeToLocalFileTime Lib "kernel32" (lpFileTime As _ FILETIME, lpLocalFileTime As FILETIME) As Long Private Declare Function LocalFileTimeToFileTime Lib "kernel32.dll" ( _ ByRef lpLocalFileTime As FILETIME, ByRef lpFileTime As FILETIME) As Long Private Declare Function GetFileTime Lib "kernel32.dll" ( _ ByVal hFile As Long, ByRef lpCreationTime As FILETIME, _ ByRef lpLastAccessTime As FILETIME, _ ByRef lpLastWriteTime As FILETIME) As Long Private Declare Function SystemTimeToVariantTime Lib "oleaut32.dll" ( _ ByRef lpSystemTime As SYSTEMTIME, ByRef vtime As Date) As Long Private Declare Function SystemTimeToTzSpecificLocalTime Lib "kernel32.dll" ( _ ByVal lpTimeZoneInformation As Any, ByRef lpUniversalTime As SYSTEMTIME, _ ByRef lpLocalTime As SYSTEMTIME) As Long Const TEST_PATH = "C:MyFile.JPG" Dim hFile As Long, ret As Long '~~> Retrieve the Create date, Modify (write) date and Last Access date of '~~> the specified file Sub GetFileTimeDemo() hFile = CreateFile(TEST_PATH, GENERIC_READ Or GENERIC_WRITE, _ FILE_SHARE_READ Or FILE_SHARE_WRITE, ByVal 0&, CREATE_ALWAYS, 0, 0) Dim ftCreate As FILETIME, ftModify As FILETIME, ftLastAccess As FILETIME Dim ft As FILETIME Dim systime_utc As SYSTEMTIME, systime_local As SYSTEMTIME, snull As SYSTEMTIME Dim tz As TIME_ZONE_INFORMATION Dim CreateDate As Date, LastAccessDate As Date, ModifyDate As Date If hFile = 0 Then Exit Sub '~~> read date information If GetFileTime(hFile, ftCreate, ftLastAccess, ftModify) Then '~~> File CreationDate FileTimeToLocalFileTime ftCreate, ft LocalFileTimeToFileTime ft, ftCreate FileTimeToSystemTime ft, systime_utc CreateDate = DateSerial(systime_utc.wYear, systime_utc.wMonth, _ systime_utc.wDay) + TimeSerial(systime_utc.wHour, systime_utc.wMinute, _ systime_utc.wSecond) + (systime_utc.wMilliseconds / 86400000) Dim ftUTC As FILETIME LocalFileTimeToFileTime ft, ftUTC '~~> File LastAccessedDate FileTimeToSystemTime ftLastAccess, systime_utc SystemTimeToTzSpecificLocalTime ByVal 0&, systime_utc, systime_local SystemTimeToVariantTime systime_local, LastAccessDate '~~> File LastModifiedDate FileTimeToSystemTime ftModify, systime_utc SystemTimeToTzSpecificLocalTime ByVal 0&, systime_utc, systime_local SystemTimeToVariantTime systime_local, ModifyDate End If Dim msg As String msg = "File Create Date/time : " & CreateDate & vbCrLf & _ "File LastAccess Date/time : " & LastAccessDate & vbCrLf & _ "File Last Modified Date/time : " & ModifyDate & vbCrLf '~~> Display the relevant info MsgBox msg, vbInformation, "File Stats" Call CloseHandle(hFile) End Sub Vb.net 0 11/17/2024 Vb.net Files File Drag Drop Listview drag drop file 3rd party Developer 12/31/25 ai search To programmatically drag multiple files from your VB.NET application and drop them onto a third-party application, you must prepare a DataObject in a standard format that other Windows programs can understand. The standard format for files is DataFormats.FileDrop. Initiating the Drag Operation In your VB.NET application, for the control you want to initiate the drag from (e.g., a Button or a ListView item), use the DoDragDrop method within a mouse event (like MouseDown): vb.net WEBTOOLS USING File1 control Private Sub File1_MouseDown(sender As Object, e As MouseEventArgs) Handles File1.MouseDown ' Create a StringCollection to hold the paths of the files you want to drag. Dim filePaths As New System.Collections.Specialized.StringCollection ' Add the full, qualified paths of the files to the collection. ' This example uses a single file for brevity; you can add multiple paths here. For Each Item As String In File1.SelectedItems Try filePaths.Add(Path.TREE2 + "" + Item.ToString) Catch ex As Exception Continue For End Try Next 'filePaths.Add(Path.Combine(Application.StartupPath, "TestData1.txt")) 'filePaths.Add(Path.Combine(Application.StartupPath, "TestData2.txt")) ' ... add all other file paths ... ' Create a DataObject and set the FileDrop list. Dim data As New DataObject() data.SetFileDropList(filePaths) ' Initiate the drag-and-drop operation, allowing "Copy" or "All" effects. ' Using DragDropEffects.Copy is standard for file drag-and-drop between apps. File1.DoDragDrop(data, DragDropEffects.Copy) End Sub =========== Imports System.IO Imports System.Windows.Forms Public Class Form1 Private originalSelection As List(Of Integer) Public Sub New() InitializeComponent() ' Example setup ListBox1.SelectionMode = SelectionMode.MultiExtended ListBox1.AllowDrop = False ' We are dragging out, not in ' Add some example file paths ListBox1.Items.Add("C:TempFile1.txt") ListBox1.Items.Add("C:TempFile2.txt") ListBox1.Items.Add("C:TempFile3.txt") End Sub ' Capture selection before mouse down Private Sub ListBox1_MouseDown(sender As Object, e As MouseEventArgs) Handles ListBox1.MouseDown originalSelection = New List(Of Integer)(ListBox1.SelectedIndices.Cast(Of Integer)()) End Sub ' Start drag without losing selection Private Sub ListBox1_MouseMove(sender As Object, e As MouseEventArgs) Handles ListBox1.MouseMove If e.Button = MouseButtons.Left AndAlso originalSelection IsNot Nothing AndAlso originalSelection.Count > 0 Then ' Restore original selection in case it changed ListBox1.ClearSelected() For Each idx In originalSelection ListBox1.SelectedIndices.Add(idx) Next ' Prepare file drop list Dim files As New List(Of String) For Each idx In originalSelection Dim path As String = ListBox1.Items(idx).ToString() If File.Exists(path) Then files.Add(path) End If Next If files.Count > 0 Then Dim data As New DataObject(DataFormats.FileDrop, files.ToArray()) ListBox1.DoDragDrop(data, DragDropEffects.Copy) End If End If End Sub End Class =========== Compatibility with Third-Party Applications When dragging between different applications, you must use the standard Windows drag-and-drop formats (like DataFormats.FileDrop). Most third-party applications that support receiving files via drag-and-drop will be listening for this standard format in their own DragEnter and DragDrop event handlers. The crucial step is creating a DataObject and using SetFileDropList() to ensure the data is provided in a standard, interoperable format. The third-party application must have its AllowDrop property set to True for the target control to accept drops. Some older or specific third-party applications might expect different data formats (like a MemoryStream or specific custom formats), but the file path array is the most common and widely supported method. For more information on programmatically simulating a drop to a third-party application without a user's manual mouse action (which is complex and often requires Windows API calls), refer to resources on programmatic drag-and-drop on Microsoft Learn. o programmatically drag a file from your VB.NET application and drop it onto a third-party application, you need to initiate a standard OLE drag-and-drop operation from your VB.NET application. The third-party application, if built to accept standard Windows file drops (like Windows Explorer or Notepad), will handle the drop automatically. Step-by-Step Implementation The key is to create a DataObject containing the file path(s) in the DataFormats.FileDrop format and then call the DoDragDrop method. 1. Set up the UI (e.g., a Button or a ListView) You'll need a control in your application from which the drag operation will start. A Button or ListView item's MouseDown event is a good place to initiate this. 2. Implement the MouseDown event In the MouseDown event of your source control, you will: Specify the full path of the file(s) you want to drag. Create a DataObject. Set the data using DataFormats.FileDrop. Call DoDragDrop to start the operation. Here is a VB.NET code snippet (for Windows Forms) that initiates a drag operation with a single file: vb.net Imports System.IO Imports System.Collections.Specialized ' Required for StringCollection Private Sub YourControl_MouseDown(sender As Object, e As MouseEventArgs) Handles YourControl.MouseDown ' Only start the drag if the left mouse button is pressed If e.Button = Windows.Forms.MouseButtons.Left Then ' Define the path(s) to the file(s) you want to drag. ' Use StringCollection for multiple files, or a String array for one or more. Dim filePaths As New StringCollection() ' Example: Add a specific file from your application's startup path Dim filePath As String = Path.Combine(Application.StartupPath, "YourFileName.txt") ' Ensure the file exists before attempting to drag it If File.Exists(filePath) Then filePaths.Add(filePath) ' Create a DataObject and set the file drop list Dim data As New DataObject() data.SetFileDropList(filePaths) ' Start the drag-and-drop operation, allowing Copy effects Me.DoDragDrop(data, DragDropEffects.Copy) Else MessageBox.Show("File not found: " & filePath) End If End If End Sub Considerations for Third-Party Applications Standard Formats: By using DataFormats.FileDrop and a StringCollection of paths, your application adheres to the standard Windows OLE drag-and-drop contract, ensuring compatibility with most third-party applications that support file drops (e.g., Windows Explorer, email clients, specific document management systems). Permissions (UIPI): Be aware of User Interface Privilege Isolation (UIPI). If your VB.NET application is running with Administrator privileges, it will not be able to drag and drop files into a third-party application running as a standard (non-administrator) user (e.g., dragging from an elevated Visual Studio instance to a normal Windows Explorer window). If this is an issue, run both applications at the same privilege level. Programmatic Drop (Advanced): If the target application does not support standard drag-and-drop or you need to automate the "drop" part of the process without user interaction (e.g., navigating to a specific folder within the target app first), this becomes significantly more complex, often requiring Windows API calls (SendMessage, WM_DROPFILES) or UI automation tools, which are beyond basic drag-and-drop functionality. The simple DoDragDrop method handles the initiation of the drag, but the target controls the drop Re: Need help dragging File FROM ListView to Explorer (and other places) Use the listview mousedown event. If the left button is held down and you have files selected, use Code: listviewname.dodragdrop(dataformats.filedrop, new string() {“file1.ext”, etc}) The dataformats and the string array of filenames are the important parts. Windows explorer will recognise your files. All of your previous code was what you’d use to enable dropping in your listview. You might want to keep your listview’s allowdrop property, and handle dragover, so you can see that something is being dragged above your listview. Don’t handle the dragdrop event if you don’t want files dropped in your listview ================================= Private Sub ListView1_DragDrop1(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListView1.DragDrop If e.Data.GetDataPresent(DataFormats.FileDrop) Then Dim MyFiles() As String Dim i As Integer ' Assign the files to an array. MyFiles = e.Data.GetData(DataFormats.FileDrop) ' Loop through the array and add the files to the list. For i = 0 To MyFiles.Length - 1 Dim lvitem As New ListViewItem lvitem.Text = System.IO.Path.GetFileNameWithoutExtension(MyFiles(i)) 'File Name "Notepad" lvitem.SubItems.Add(My.Computer.FileSystem.GetFileInfo(MyFiles(i)).Extension) 'Just the extension, soon to be type lvitem.SubItems.Add(((My.Computer.FileSystem.GetFileInfo(MyFiles(i)).Length) / 1000) & " KB") 'File Size e.g. "2,400KB" lvitem.SubItems.Add(My.Computer.FileSystem.GetFileInfo(MyFiles(i)).DirectoryName) 'Path ListView1.Items.Add(lvitem) Next End If End Sub 3rd party To programmatically simulate a drag-and-drop operation in VB.NET, where files are dropped into a third-party application, you can use the DoDragDrop method in combination with the Windows API for more advanced scenarios. Below is an example of how you can achieve this: Example: Drag and Drop Files to a Third-Party Application Imports System.Runtime.InteropServices Imports System.Windows.Forms Public Class DragDropHelper Private Shared Function FindWindow(lpClassName As String, lpWindowName As String) As IntPtr End Function Private Shared Function SendMessage(hWnd As IntPtr, Msg As Integer, wParam As IntPtr, lParam As IntPtr) As IntPtr End Function Private Const WM_DROPFILES As Integer = &H233 Public Shared Sub DragAndDropFile(filePath As String, targetWindowTitle As String) ' Find the target window by its title Dim targetWindowHandle As IntPtr = FindWindow(Nothing, targetWindowTitle) If targetWindowHandle = IntPtr.Zero Then MessageBox.Show("Target application window not found.") Return End If ' Create a DataObject containing the file path Dim dataObject As New DataObject(DataFormats.FileDrop, New String() {filePath}) ' Simulate the drag-and-drop operation Clipboard.SetDataObject(dataObject, True) SendMessage(targetWindowHandle, WM_DROPFILES, IntPtr.Zero, IntPtr.Zero) End Sub End Class Another example using file explorer Private Sub Form1_MouseDown(sender As Object, e As MouseEventArgs) Handles Me.MouseDown Dim data As New DataObject() Dim filePaths As New StringCollection filePaths.Add(Path.Combine(Application.StartupPath, "TestData.txt")) data.SetFileDropList(filePaths) DoDragDrop(data, DragDropEffects.Copy) End Sub Vb.net 1 01/03/2026 Vb.net Formatting Replacing Text In A String replace trim Replacing Dim APOS2 As Integer, APOS As Integer A = Replace(A, Chr(9), " ") APOS2 = Len(A) : APOS = Len(LTrim$(A)) : APOS = APOS2 - APOS A = Trim$(A) A = Replace(A, Chr(34), Chr(34) + "+chr(34)+" + Chr(34)) Vb.net 0 01/13/2025 Vb.net Formatting Sort Files By Date delete sort listbox list box date files selected Webtools File Management Remove unwanted items always LOOP BACKWARDS ' Define the unwanted text Dim unwantedText As String = "Unwanted Item Text" ' Loop backwards from the last item to the first (ListBox.Items is 0-based) For i As Integer = ListBox1.Items.Count - 1 To 0 Step -1 ' Check if the current item matches the unwanted text If ListBox1.Items(i).ToString() = unwantedText Then ' If it matches, remove the item at the current index ListBox1.Items.RemoveAt(i) End If Next 'PRINT CONTENT TO VIEW DIM B AS string For i As Integer = 0 to ListBox1.Items.Count - 1 B=B + ListBox1.Items(i).ToString()+VBCRLF Next table.text=B 'PRINT SELECTED CONTENT TO VIEW If ListBox1.SelectedItems.Count > 0 Then MessageBox.Show("Processing " & ListBox1.SelectedItems.Count.ToString() & " items.") ' Loop through each selected item in the collection For Each selectedItem As Object In ListBox1.SelectedItems ' You can cast the item to a specific type if needed (e.g., String) Dim itemText As String = selectedItem.ToString() ' Perform your processing logic here Debug.WriteLine("Processing item: " & itemText) ' Example: add to another listbox ' ListBox2.Items.Add(itemText) Next ' Optional: Clear the selection after processing ' ListBox1.ClearSelected() Else MessageBox.Show("No items selected.") End If webtools Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btDateSort.Click Dim J As Integer, N As Integer = 0, N2 As Integer = 0 Dim DateFile As Array = Directory.GetFiles(Path.TREE2).OrderBy(Function(d) New FileInfo(d).CreationTime).ToArray File1.Items.Clear() N = DateFile(J).LastIndexOf("") For J = 0 To DateFile.Length - 1 N2 = DateFile(J).length - N - 1 File1.Items.Add(DateFile(J).substring(N + 1, N2)) Next End Sub StrFilesArray=Directory.GetFiles(DirectoryPath).OrderBy(Function(d) New FileInfo(d).CreationTime).ToArray Dim name As String Dim list As List(of DateTime) = new List(of DateTime) For Each file As String In System.IO.Directory.GetFiles(directoryPath) name = System.IO.Path.GetFileNameWithoutExtension(file) list.Add(Datetime.ParseExact(name, "dd-MM-yyyy", CultureInfo.InvariantCulture)) Next list.Sort(New Comparison(Of Date)(Function(x As Date, y As Date) y.CompareTo(x))) ComboBox1.DataSource = list Vb.net 3 01/25/2026 Vb.net Function Populating The Treeview List treeview files directory Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load PopulateTreeView(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)) End Sub Private Sub PopulateTreeView(path As String) ' Clear the TreeView control TreeView1.Nodes.Clear() ' Create the root node for the TreeView Dim rootNode = New TreeNode(path) With {.Tag = path} TreeView1.Nodes.Add(rootNode) ' Recursively add child nodes for directories and their files AddDirectories(rootNode) End Sub Private Sub AddDirectories(parentNode As TreeNode) ' Get the path of the parent node Dim path = DirectCast(parentNode.Tag, String) ' Get the directories in the current path Dim directories = IO.Directory.GetDirectories(path) ' Add child nodes for each directory For Each dir As String In directories Dim directoryNode = New TreeNode(IO.Path.GetFileName(dir)) With {.Tag = dir} parentNode.Nodes.Add(directoryNode) Try ' Get the files in the current directory Dim files = IO.Directory.GetFiles(dir) ' Add child nodes for each file For Each file In files Dim fileNode = New TreeNode(IO.Path.GetFileName(file)) With {.Tag = file} directoryNode.Nodes.Add(fileNode) Next ' Recursively add child nodes for subdirectories AddDirectories(directoryNode) Catch invalidAccessEx As UnauthorizedAccessException directoryNode.ForeColor = Color.Red End Try Next End Sub Vb.net 1 12/27/2023 Vb.net Function Outlook Email outlook move email OUTLOOK If you're looking to move Outlook emails into an Outlook Data File (.pst) using VB.NET, you can achieve this programmatically using the Outlook Object Model. Here's a breakdown of the process: Understand the Outlook Object Model: The Outlook Object Model provides a set of classes and objects that allow you to interact with various components of Outlook, including emails, folders, and data files. Establish a connection to Outlook: You'll need to create an instance of the Outlook.Application object to start interacting with Outlook. Access the Outlook Data File (.pst): Once connected to Outlook, you can use the Application.Session.Stores collection to access the different data files (including .pst files) currently open in Outlook. Identify the target folder within the .pst file: Navigate through the folders within the .pst file to pinpoint the specific folder where you want to move the emails. Iterate through the emails in the source folder: Locate the emails you intend to move by iterating through the Items collection of the source folder (e.g., Inbox, Sent Items). Move the emails: For each email you want to move, use the MailItem.Move method, specifying the target folder as the destination. Example (Conceptual Outline) This code snippet provides a basic illustration of how you might approach this task in VB.NET. vb.net Imports Outlook Public Class EmailMover Private Sub MoveEmailsToPST() Try Dim outlookApp As New Outlook.Application() Dim olNamespace As Outlook.NameSpace = outlookApp.GetNamespace("MAPI") ' --- Identify the PST file (Outlook Data File) --- Dim targetPST As Outlook.Store = Nothing For Each store As Outlook.Store In olNamespace.Stores If store.DisplayName = "My Outlook Data File" Then ' Replace with the actual name of your PST file targetPST = store Exit For End If Next If targetPST Is Nothing Then MessageBox.Show("Outlook Data File (PST) not found!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) Exit Sub End If ' --- Identify the target folder within the PST file --- Dim targetFolder As Outlook.MAPIFolder = Nothing For Each folder As Outlook.MAPIFolder In targetPST.GetRootFolder().Folders If folder.Name = "Archive" Then ' Replace with the actual name of your archive folder in the PST targetFolder = folder Exit For End If Next If targetFolder Is Nothing Then MessageBox.Show("Target folder within PST not found!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) Exit Sub End If ' --- Get the source folder (e.g., Inbox) --- Dim inboxFolder As Outlook.MAPIFolder = olNamespace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox) ' --- Loop through the emails in the Inbox and move them --- For Each mailItem As Object In inboxFolder.Items If TypeOf mailItem Is Outlook.MailItem Then Dim email As Outlook.MailItem = DirectCast(mailItem, Outlook.MailItem) ' Add your criteria for moving emails here (e.g., based on sender, subject, date) If email.Subject.Contains("Old Project") Then ' Example: Move emails with "Old Project" in the subject email.Move(targetFolder) MessageBox.Show("Email moved: " & email.Subject, "Success", MessageBoxButtons.OK, MessageBoxIcon.Information) End If End If Next MessageBox.Show("Email moving process completed.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information) Catch ex As Exception MessageBox.Show("An error occurred: " & ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub End Class Important notes .Contains is case sensitive if (email.subject.toLowerCase().indexOf("INC") > -1) { // Execute code for emails with "INC" in the subject (case-insensitive) // For example, update an incident record } Replace placeholders: Be sure to replace "My Outlook Data File" and "Archive" with the actual names of your Outlook data file (.pst) and the specific folder within it where you want to move the emails. Error Handling: Include robust error handling in your code to address potential issues like missing files, network problems, or access errors. User Interface (UI): If you are developing a desktop application, you can integrate this logic with a user interface that allows the user to select the source and destination folders, apply filters, and initiate the moving process. Security and Permissions: Ensure your application has the necessary permissions to interact with Outlook and access the Outlook Data Files Vb.net 4 07/21/2025 Vb.net Function Calling A Click Event call Vb.net Events Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Button2_Click(Sender, e) End Sub BTbulkMove_Click(sender As Object, e As EventArgs) translates to BTbulkMove_Click(sender, e) BTtest_Click(sender As Object, e As EventArgs) translates to BTtest_Click(sender, e) Vb.net 0 08/21/2025 Vb.net Function Function Variable Passing function Function Key Points: ByVal passes a copy of the variable. Changes inside the function do not modify the original variable. This is the default passing mechanism in VB.NET if you don’t specify ByRef. When to use ByVal When you want to protect the original variable from being changed. When passing immutable data (e.g., numbers, strings) where modification is unnecessary. If you want, I can also show you the ByRef version so you can compare how it changes the original variable Function EmailCriteria(ByRef email_count As Int16) Dim MV(200, 2) As String, L As Integer Try Dim sqL As String = "SELECT [move_to],[subject_filter],[archive] FROM [move_email] WHERE [archive]>0 ORDER BY [move_to],[subject_filter]" ConnDB() cmd = New OleDbCommand(sqL, conn) dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) Catch ex As Exception LAerrorMessage.Text = "error BTbulkMove DB:" & ex.Message End Try Do While dr.Read MV(L, 0) = dr(0) : MV(L, 1) = dr(1) : MV(L, 2) = dr(2) L = L + 1 Loop email_count = L - 1 Return MV End Function Vb.net 0 02/28/2026 Vb.net Ini Read And Write From Ini File ini windows API api Include inside a function routine Public Path As Path_, MarkIt As marker_ Public INI As String, INN As String, LogErr As Integer, RegDir As String, RegSet As String, gBreak As Boolean Public Const vbCR = vbCrLf, vbEmpty = Chr(34) + Chr(34) Public Const VK_ESCAPE& = &H1B, VK_LBUTTON& = &H1 Public gAccess As Integer Declare Auto Function GetPrivateProfileString Lib "kernel32" ( _ ByVal lpAppName As String, _ ByVal lpKeyName As String, _ ByVal lpDefault As String, _ ByVal lpReturnedString As System.Text.StringBuilder, _ ByVal nSize As Integer, _ ByVal lpFileName As String) As Integer Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Int32) As UShort Declare Auto Function WritePrivateProfileString Lib "kernel32" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Integer Public Function GetIni(ByVal section As String, ByVal L As String, ByVal fil0$) As String Dim fil$ On Error Resume Next fil$ = fil0$ L = LTrim$(L) Dim R As New System.Text.StringBuilder(256) Dim retVal As Integer = GetPrivateProfileString(section, L, "", R, R.Capacity, fil0$) 'X = GetPrivateProfileString(section, L, "none", R, 50, fil) 'R = Trim(R) : R = Left$(R, Len(R) - 1) Return R.ToString 'GetIni = R End Function Public Function WriteIni(ByVal section$, ByVal L$, ByVal R$, ByVal fil0$) As Integer Dim X As Long, fil$ On Error Resume Next L$ = Trim$(L$) : fil = fil0 X = WritePrivateProfileString(section$, L$, R$, fil) 'If L$ <> "" And fil$ = INI Then Call SetKeyValue(RegSet, L$, R$) Return True End Function R$ = GetIni("Setup", "cloud", INI) WriteIni("Setup", "cloud", "C:UserssteveDropboxvb10fileExplorerfileExplorerbinReleasePHPCreator.mdb", INI) Vb.net 3 11/17/2025 Vb.net Keyboard Clipboard clipboard html text If Clipboard.ContainsText() And TXJoin1.Text = "" Then TXJoin1.Paste() End If Private Sub btClipDir_Click(sender As Object, e As EventArgs) Handles btClipDir.Click Dim FL1 As String, ALLFile As String = "" FL1 = Dir(Path.TREE2 + "") ALLFile = PrintDirectory(Path.TREE2) If ALLFile <> "" Then Clipboard.SetText(ALLFile, TextDataFormat.UnicodeText) End Sub Clear Removes all data from the Clipboard. Public methodStatic member ContainsAudio Indicates whether there is data on the Clipboard in the WaveAudio format. Public methodStatic member ContainsData Indicates whether there is data on the Clipboard that is in the specified format or can be converted to that format. Public methodStatic member ContainsFileDropList Indicates whether there is data on the Clipboard that is in the FileDrop format or can be converted to that format. Public methodStatic member ContainsImage Indicates whether there is data on the Clipboard that is in the Bitmap format or can be converted to that format. Public methodStatic member ContainsText() Indicates whether there is data on the Clipboard in the Text or UnicodeText format, depending on the operating system. Public methodStatic member ContainsText(TextDataFormat) Indicates whether there is text data on the Clipboard in the format indicated by the specified TextDataFormat value. Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.) Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) Public methodStatic member GetAudioStream Retrieves an audio stream from the Clipboard. Public methodStatic member GetData Retrieves data from the Clipboard in the specified format. Public methodStatic member GetDataObject Retrieves the data that is currently on the system Clipboard. Public methodStatic member GetFileDropList Retrieves a collection of file names from the Clipboard. Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.) Public methodStatic member GetImage Retrieves an image from the Clipboard. Public methodStatic member GetText() Retrieves text data from the Clipboard in the Text or UnicodeText format, depending on the operating system. Public methodStatic member GetText(TextDataFormat) Retrieves text data from the Clipboard in the format indicated by the specified TextDataFormat value. Public method GetType Gets the Type of the current instance. (Inherited from Object.) Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.) Public methodStatic member SetAudio(Byte[]) Clears the Clipboard and then adds a Byte array in the WaveAudio format after converting it to a Stream. Public methodStatic member SetAudio(Stream) Clears the Clipboard and then adds a Stream in the WaveAudio format. Public methodStatic member SetData Clears the Clipboard and then adds data in the specified format. Public methodStatic member SetDataObject(Object) Clears the Clipboard and then places nonpersistent data on it. Public methodStatic member SetDataObject(Object, Boolean) Clears the Clipboard and then places data on it and specifies whether the data should remain after the application exits. Public methodStatic member SetDataObject(Object, Boolean, Int32, Int32) Clears the Clipboard and then attempts to place data on it the specified number of times and with the specified delay between attempts, optionally leaving the data on the Clipboard after the application exits. Public methodStatic member SetFileDropList Clears the Clipboard and then adds a collection of file names in the FileDrop format. Public methodStatic member SetImage Clears the Clipboard and then adds an Image in the Bitmap format. Public methodStatic member SetText(String) Clears the Clipboard and then adds text data in the Text or UnicodeText format, depending on the operating system. Public methodStatic member SetText(String, TextDataFormat) Clears the Clipboard and then adds text data in the format indicated by the specified TextDataFormat value. Public method ToString Returns a string that represents the current object. (Inherited from Object.) Vb.net 1205 08/05/2024 Vb.net Language Split Variable Into Array explode split Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Dim str As String Dim strArr() As String Dim count As Integer str = "vb.net split test" strArr = str.Split(" ") For count = 0 To strArr.Length - 1 MsgBox(strArr(count)) Next End Sub End Class Vb.net 2 09/09/2023 Vb.net Language Using Try To Catch Errors try errors Mail Dim stream As FileStream = Nothing Try ' Try to open with exclusive access stream = File.Open(TREE3 + FLD(0, 0) + "_header.php", FileMode.Open, FileAccess.ReadWrite, FileShare.None) ' No exception means file is not locked Catch ex As IOException MsgBox(" IOException usually means the file is in use") Catch ex As UnauthorizedAccessException MsgBox("' Could be read-only or permission issue") Finally ' Ensure the stream is closed if it was opened If stream IsNot Nothing Then stream.Close() stream.Dispose() End If End Try ================= Dim tempApp As Outlook.Application, PATH1 As String = Application.StartupPath, BODY As String = "", SECTION1 As String = "", FOUND1 As Boolean = False Dim tempInbox As Outlook.MAPIFolder Dim InboxItems As Outlook.Items Dim J As Int16, i As Integer = 0, Subject As String = "" If Dir(PATH1 + "spamfilter.txt") = "" Then MsgBox("No spam filter. I am leaving") : Exit Sub Dim CODE1 As String = LCase(My.Computer.FileSystem.ReadAllText(PATH1 + "spamfilter.txt")) ' read spam filter Dim FILTER1() As String = Split(CODE1, vbCrLf) 'Dim objattachments, objAttach tempApp = CreateObject("Outlook.Application") 'tempInbox = tempApp.GetNamespace("Mapi").GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox) tempInbox = tempApp.GetNamespace("Mapi").PickFolder Try InboxItems = tempInbox.Items Catch ex As Exception Console.WriteLine("Can't load Subject" & vbCrLf & ex.Message) MsgBox("nothing is selected") : Exit Sub End Try Dim newMail As Outlook.MailItem For Each newMail In InboxItems Try Subject = newMail.Subject Catch ex As Exception Console.WriteLine("Can't load Subject" & vbCrLf & ex.Message) Continue For End Try Try SECTION1 = LCase(newMail.SenderEmailAddress) Catch ex As Exception Console.WriteLine("Can't load email address" & vbCrLf & ex.Message) Continue For End Try 'SECTION1 = LCase(newMail.SenderName + vbCrLf + newMail.SenderEmailAddress + vbCrLf + newMail.Subject + vbCrLf) 'BODY = LCase(newMail.Body) FOUND1 = False For J = 0 To FILTER1.Count - 1 If InStr(SECTION1, FILTER1(J)) > 0 Then FOUND1 = True : Exit For Next 'If FOUND1 = True Then Continue For If FOUND1 = False Then Try newMail.Delete() Catch ex As Exception Console.WriteLine("Can't delete email address" & vbCrLf & ex.Message) Continue For End Try End If ' End If Next Application.DoEvents() 'Next InboxItems = Nothing tempInbox = Nothing tempApp = Nothing MsgBox("Done") : Exit Sub Vb.net 0 01/01/2024 Vb.net Setup How To: Change The Default Location For Projects Default Location Projects folder How to: Change the Default Location for Projects Visual Studio 2010 Other Versions 13 out of 21 rated this helpful - Rate this topic You can change the path where new projects and files are created by using the Options dialog box. Your existing projects remain in their current location. Web-related projects, such as XML Web services and ASP.NET Web applications, are not affected by this setting. The default Web server is based on the most recently used server. To change the default save location On the Tools menu, select Options. From the Projects and Solutions folder, select General. In the Visual Studio projects location text box, enter a location for files and projects. Vb.net 1850 09/09/2023 Vb.net Setup Have Application Run In The Background application background process file explorer http://www.dreamincode.net/forums/topic/59527-make-a-program-to-run-in-the-background/ This tutorial deals with how to make a standard VB.NET application run in the background, like a process. By background i mean that the application will have no interface (form or console) and will run from a Sub Main(), but will not terminate once all the code in Main has executed. That means your program will run like a normal form application, and will only exit when told to. First, create a standard Windows Form application. Then, go to the solution explorer, and double click on the item that says My Project. [attachment=7480:attachment] Once that is opened, you should see something like this [attachment=7484:attachment] There are a few very simple things you need to change there. First, uncheck the box that says "Enable Application Framework". Then, go to the box that says "Startup Object:" and change that to Sub Main. Then, delete the form that was put in your application automatically. By now, you should notice that there is no startup object in your application. In fact, there is no Code in your application. So, you need to add a Sub Main in. Add a new module to your application (call it anything you want). Then, add this sub into your module: 1Sub Main()2 'This will execute when your application3 'starts up. This is the equivilent of a4 'Form_Load event in a form application.5 'Put whatever code you want in this sub,6 'but make sure you end it with this statement:7 Application.Run()8End Sub Let me explain exactly what this is doing. When you changed the startup object to Sub Main, you application will execute from a Main routine, like a console application, so what is stopping it from showing a console window? Notice the box that says "Application Type:". You will see that that is set to "Windows Form Application". When you create a console application, that box is set to "Console Application". When you create any windows form application, there, of course, is no console window. That is because the application has a type of "Windows Form Application", which basically means your application will not show a console. Of course, in Consle Applications, there are no forms. So what happens when you application's type is Windows Form Application, and there is no form in it? Your program will have no interface at all. But, even though your application is called a Windows Form Application, it will still exit once all the code in Sub Main has executed, like a console application. To prevent that, you must have a line at the end of your Main routine that says Application.Run(). That line will prevent your application from closing right after Main has finished. Now, it will run like a standard form application, just with no form, and the only way you can close it is with an Application.Exit() call. And it's as simple as that. You can treat the module your main routine is in as if it was the code for your form. The only difference is, there is no form, and you can't add controls to it in the designer (because there is no interface there to design). So, for example, if you wanted to add a timer to your application, you can't just drag-and-drop it on the form, you have to get down and dirty and add it in manually, with something like this 1Friend WithEvents Timer1 As New Timer() That will create a timer object, exactly as if it was created by the designer. To add a tick event handler for it, go to the box near the top-left of the code editor. Select the item that says "Timer1", or whatever you called your timer. Then, select the box next to it and it will show a list of events for that control. Click the one you want, Tick in this case, and it will add an event handler for that event directly into your code. Private Sub laPath_DoubleClick(sender As Object, e As EventArgs) Handles laPath.DoubleClick Dim filePath As String = laPath.Text 'Example file Process.Start("explorer.exe", "/select," & filePath) : Application.DoEvents() End Sub Vb.net 1215 09/09/2023 Vb.net Setup Compiling Error Locations errors optimization Locating Bug Fixes optimize error Project- project properties (located towards bottom) Compile -towards bottom "Advanced Compile Options" uncheck "Enable Optimizations" ============ Resolving the 'Microsoft.Jet.OLEDB.4.0' Provider Not Registered Er… 1 2 3 The error Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine typically occurs when you try to use the Microsoft Jet OLEDB 4.0 driver on a 64-bit operating system. This driver is not compatible with 64-bit systems, leading to this error. Example string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;"; using (OleDbConnection connection = new OleDbConnection(connectionString)) { connection.Open(); // Perform database operations } Solution 1: Change Project Build Configuration One common solution is to change the build configuration of your project to target x86 (32-bit) instead of Any CPU or x64. Steps: Open your project in Visual Studio. Go to Project Properties > Build. Change the Platform target to x86. Rebuild your project. Solution 2: Use Microsoft.ACE.OLEDB.12.0 Another solution is to use the Microsoft Access Database Engine, which provides a 64-bit compatible driver. Example: string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\mydatabase.accdb;"; using (OleDbConnection connection = new OleDbConnection(connectionString)) { connection.Open(); // Perform database operations } Solution 3: Enable 32-bit Applications in IIS If you are running a web application, you can enable 32-bit applications in IIS 3 . Steps: Open IIS Manager. Select the application pool your application is using. Click on Advanced Settings. Set Enable 32-Bit Applications to True. By following these steps, you can resolve the Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine error and ensure your application runs smoothly on both 32-bit and 64-bit systems. Learn more: 1 - stackoverflow.com 2 - answers.microsoft.com 3 - stackoverflow.com Resolving the 'Microsoft.Jet.OLEDB.4.0' Provider Not Registered Er… 1 2 3 The error Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine typically occurs when you try to use the Microsoft Jet OLEDB 4.0 driver on a 64-bit operating system. This driver is not compatible with 64-bit systems, leading to this error. Example string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;"; using (OleDbConnection connection = new OleDbConnection(connectionString)) { connection.Open(); // Perform database operations } Solution 1: Change Project Build Configuration One common solution is to change the build configuration of your project to target x86 (32-bit) instead of Any CPU or x64. Steps: Open your project in Visual Studio. Go to Project Properties > Build. Change the Platform target to x86. Rebuild your project. Solution 2: Use Microsoft.ACE.OLEDB.12.0 Another solution is to use the Microsoft Access Database Engine, which provides a 64-bit compatible driver. Example: string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\mydatabase.accdb;"; using (OleDbConnection connection = new OleDbConnection(connectionString)) { connection.Open(); // Perform database operations } Solution 3: Enable 32-bit Applications in IIS If you are running a web application, you can enable 32-bit applications in IIS 3 . Steps: Open IIS Manager. Select the application pool your application is using. Click on Advanced Settings. Set Enable 32-Bit Applications to True. By following these steps, you can resolve the Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine error and ensure your application runs smoothly on both 32-bit and 64-bit systems. Learn more: 1 - stackoverflow.com 2 - answers.microsoft.com 3 - stackoverflow.com Vb.net 0 07/23/2025 Vb.net String String Functions substring [CHAR] '// see indexof also Dim myString As String = "ABCDE" Dim myChar As Char myChar = myString.Chars(3) '//myChar = "D" [CONCAT] Dim aString As String = "A" Dim bString As String = "B" Dim cString As String = "C" Dim dString As String = "D" Dim myString As String ' myString = "ABCD" myString = String.Concat(aString, bString, cString, dString) [INDEXOF] '// see char also Dim myString As String = "ABCDE" Dim myInteger As Integer myInteger = myString.IndexOf("D") ' myInteger = 3 [instr] [left] [LENGTH] Dim MyString As String = "This is my string" Dim stringLength As Integer ' Explicitly set the string to Nothing. MyString = Nothing ' stringLength = 0 stringLength = Len(MyString) ' This line, however, causes an exception to be thrown. stringLength = MyString.Length [MID] '//see substring. first charcter is position 1 Dim aString As String = "SomeString" Dim bString As String bString = Mid(aString, 3, 3) [right] [SPLIT] '// returns an array Dim shoppingList As String = "Milk,Eggs,Bread" Dim shoppingItem(2) As String shoppingItem = shoppingList.Split(","c) [SUBSTRING] '//first character is position zero. See mid() Dim aString As String = "A String" Dim bString As String bString = aString.SubString(2,6) '//bString = "String" or Dim aString As String = "Left Center Right" Dim subString As String ' subString = "Center" subString = aString.SubString(5,6) Visual Basic .NET methods are used as inherent functions of the language. They may be used without qualification in your code. The following example shows typical use of a Visual Basic .NET string-manipulation command: In this example, the Mid function performs a direct operation on aString and assigns the value to bString. You can also manipulate strings with the methods of the String class. There are two types of methods in String: shared methods and instance methods. A shared method is a method that stems from the String class itself and does not require an instance of that class to work. These methods can be qualified with the name of the class (String) rather than with an instance of the String class. For example: Dim aString As String bString = String.Copy("A literal string") In the preceding example, the String.Copy method is a static method, which acts upon an expression it is given and assigns the resulting value to bString. NET runtime evaluates Nothing as an empty string; that is, "". The .NET Framework, however, does not, and will throw an exception whenever an attempt is made to perform a string operation on Nothing. Comparing Strings You can compare two strings by using the String.Compare method. This is a static, overloaded method of the base string class. In its most common form, this method can be used to directly compare two strings based on their alphabetical sort order. This is similar to the Visual Basic StrComp Function function. The following example illustrates how this method is used: Dim myString As String = "Alphabetical" Dim secondString As String = "Order" Dim result As Integer result = String.Compare (myString, secondString) This method returns an integer that indicates the relationship between the two compared strings based on the sorting order. A positive value for the result indicates that the first string is greater than the second string. A negative result indicates the first string is smaller, and zero indicates equality between the strings. Any string, including an empty string, evaluates to greater than a null reference. Additional overloads of the String.Compare method allow you to indicate whether or not to take case or culture formatting into account, and to compare substrings within the supplied strings. For more information on how to compare strings, see String.Compare Method. Related methods include String.CompareOrdinal Method and String.CompareTo Method. Searching for Strings Within Your Strings There are times when it is useful to have data about the characters in your string and the positions of those characters within your string. A string can be thought of as an array of characters (Char instances); you can retrieve a particular character by referencing the index of that character through the Chars property. For example: You can use the String.IndexOf method to return the index where a particular character is encountered, as in the following example: Dim myString As String = "ABCDE" Dim myInteger As Integer myInteger = myString.IndexOf("D") ' myInteger = 3 In the previous example, the IndexOf method of myString was used to return the index corresponding to the first instance of the character "C" in the string. IndexOf is an overloaded method, and the other overloads provide methods to search for any of a set of characters, or to search for a string within your string, among others. The Visual Basic .NET command InStr also allows you to perform similar functions. For more information of these methods, see String.IndexOf Method and InStr Function. You can also use the String.LastIndexOf Method to search for the last occurrence of a character in your string. Creating New Strings from Old When using strings, you may want to modify your strings and create new ones. You may want to do something as simple as convert the entire string to uppercase, or trim off trailing spaces; or you may want to do something more complex, such as extracting a substring from your string. The System.String class provides a wide range of options for modifying, manipulating, and making new strings out of your old ones. To combine multiple strings, you can use the concatenation operators (& or +). You can also use the String.Concat Method to concatenate a series of strings or strings contained in objects. An example of the String.Concat method follows: You can convert your strings to all uppercase or all lowercase strings using either the Visual Basic .NET functions UCase Function and LCase Function or the String.ToUpper Method and String.ToLower Method methods. An example is shown below: Dim myString As String = "UpPeR oR LoWeR cAsE" Dim newString As String ' newString = "UPPER OR LOWER CASE" newString = UCase(myString) ' newString = "upper or lower case" newString = LCase(myString) ' newString = "UPPER OR LOWER CASE" newString = myString.ToUpper ' newString = "upper or lower case" newString = myString.ToLower The String.Format method and the Visual Basic .NET Format command can generate a new string by applying formatting to a given string. For information on these commands, see Format Function or String.Format Method. You may at times need to remove trailing or leading spaces from your string. For instance, you might be parsing a string that had spaces inserted for the purposes of alignment. You can remove these spaces using the String.Trim Method function, or the Visual Basic .NET Trim function. An example is shown: Dim spaceString As String = _ " This string will have the spaces removed " Dim oneString As String Dim twoString As String ' This removes all trailing and leading spaces. oneString = spaceString.Trim ' This also removes all trailing and leading spaces. twoString = Trim(spaceString) If you only want to remove trailing spaces, you can use the String.TrimEnd Method or the RTrim function, and for leading spaces you can use the String.TrimStart Method or the LTrim function. For more details, see LTrim, RTrim, and Trim Functions functions. The String.Trim functions and related functions also allow you to remove instances of a specific character from the ends of your string. The following example trims all leading and trailing instances of the "#" character: Dim myString As String = "#####Remove those!######" Dim oneString As String OneString = myString.Trim("#") You can also add leading or trailing characters by using the String.PadLeft Method or the String.PadRight Method. If you have excess characters within the body of your string, you can excise them by using the String.Remove Method, or you can replace them with another character using the String.Replace Method. For example: Dim aString As String = "This is My Str@o@o@ing" Dim myString As String Dim anotherString As String ' myString = "This is My String" myString = aString.Remove(14, 5) ' anotherString = "This is Another String" anotherString = myString.Replace("My", "Another") You can use the String.Replace method to replace either individual characters or strings of characters. The Visual Basic .NET Mid Statement can also be used to replace an interior string with another string. You can also use the String.Insert Method to insert a string within another string, as in the following example: Dim aString As String = "This is My Stng" Dim myString As String ' Results in a value of "This is My String". myString = aString.Insert(13, "ri") The first parameter that the String.Insert method takes is the index of the character the string is to be inserted after, and the second parameter is the string to be inserted. You can concatenate an array of strings together with a separator string by using the String.Join Method. Here is an example: Dim shoppingItem(2) As String Dim shoppingList As String shoppingItem(0) = "Milk" shoppingItem(1) = "Eggs" shoppingItem(2) = "Bread" shoppingList = String.Join(",", shoppingItem) The value of shoppingList after running this code is "Milk,Eggs,Bread". Note that if your array has empty members, the method still adds a separator string between all the empty instances in your array. You can also create an array of strings from a single string by using the String.Split Method. The following example demonstrates the reverse of the previous example: it takes a shopping list and turns it into an array of shopping items. The separator in this case is an instance of the Char data type; thus it is appended with the literal type character c. The Visual Basic .NET Mid Function can be used to generate substrings of your string. The following example shows this functions in use: Dim aString As String = "Left Center Right" Dim rString, lString, mString As String ' rString = "Right" rString = Mid(aString, 13) ' lString = "Left" lString = Mid(aString, 1, 4) ' mString = "Center" mString = Mid(aString, 6,6) Substrings of your string can also be generated using the String.Substring Method. This method takes two arguments: the character index where the substring is to start, and the length of the substring. The String.Substring method operates much like the Mid function. An example is shown below: There is one very important difference between the String.SubString method and the Mid function. The Mid function takes an argument that indicates the character position for the substring to start, starting with position 1. The String.SubString method takes an index of the character in the string at which the substring is to start, starting with position 0. Thus, if you have a string "ABCDE", the individual characters are numbered 1,2,3,4,5 for use with the Mid function, but 0,1,2,3,4 for use with the System.String function. Vb.net 1054 09/09/2023 Vb.net String Array Manipulation count split explode [Return number of element in array] dotg.count= items in array [Split a patterned string into separate elements like a csv file] myfile="dog,10,cat,40,fish,50" dotg=split(myfile,",") Vb.net 1039 09/09/2023 Vb.net String Some Good String Functions concat length mid [CHAR] '// see indexof also Dim myString As String = "ABCDE" Dim myChar As Char myChar = myString.Chars(3) '//myChar = "D" [CONCAT] Dim aString As String = "A" Dim bString As String = "B" Dim cString As String = "C" Dim dString As String = "D" Dim myString As String ' myString = "ABCD" myString = String.Concat(aString, bString, cString, dString) [INDEXOF] '// see char also Dim myString As String = "ABCDE" Dim myInteger As Integer myInteger = myString.IndexOf("D") ' myInteger = 3 [instr] [left] [LENGTH] Dim MyString As String = "This is my string" Dim stringLength As Integer ' Explicitly set the string to Nothing. MyString = Nothing ' stringLength = 0 stringLength = Len(MyString) ' This line, however, causes an exception to be thrown. stringLength = MyString.Length [MID] '//see substring. first charcter is position 1 Dim aString As String = "SomeString" Dim bString As String bString = Mid(aString, 3, 3) [right] [SPLIT] '// returns an array Dim shoppingList As String = "Milk,Eggs,Bread" Dim shoppingItem(2) As String shoppingItem = shoppingList.Split(","c) [SUBSTRING] '//first character is position zero. See mid() Dim aString As String = "A String" Dim bString As String bString = aString.SubString(2,6) '//bString = "String" or Dim aString As String = "Left Center Right" Dim subString As String ' subString = "Center" subString = aString.SubString(5,6) Visual Basic .NET methods are used as inherent functions of the language. They may be used without qualification in your code. The following example shows typical use of a Visual Basic .NET string-manipulation command: In this example, the Mid function performs a direct operation on aString and assigns the value to bString. You can also manipulate strings with the methods of the String class. There are two types of methods in String: shared methods and instance methods. A shared method is a method that stems from the String class itself and does not require an instance of that class to work. These methods can be qualified with the name of the class (String) rather than with an instance of the String class. For example: Dim aString As String bString = String.Copy("A literal string") In the preceding example, the String.Copy method is a static method, which acts upon an expression it is given and assigns the resulting value to bString. NET runtime evaluates Nothing as an empty string; that is, "". The .NET Framework, however, does not, and will throw an exception whenever an attempt is made to perform a string operation on Nothing. Comparing Strings You can compare two strings by using the String.Compare method. This is a static, overloaded method of the base string class. In its most common form, this method can be used to directly compare two strings based on their alphabetical sort order. This is similar to the Visual Basic StrComp Function function. The following example illustrates how this method is used: Dim myString As String = "Alphabetical" Dim secondString As String = "Order" Dim result As Integer result = String.Compare (myString, secondString) This method returns an integer that indicates the relationship between the two compared strings based on the sorting order. A positive value for the result indicates that the first string is greater than the second string. A negative result indicates the first string is smaller, and zero indicates equality between the strings. Any string, including an empty string, evaluates to greater than a null reference. Additional overloads of the String.Compare method allow you to indicate whether or not to take case or culture formatting into account, and to compare substrings within the supplied strings. For more information on how to compare strings, see String.Compare Method. Related methods include String.CompareOrdinal Method and String.CompareTo Method. Searching for Strings Within Your Strings There are times when it is useful to have data about the characters in your string and the positions of those characters within your string. A string can be thought of as an array of characters (Char instances); you can retrieve a particular character by referencing the index of that character through the Chars property. For example: You can use the String.IndexOf method to return the index where a particular character is encountered, as in the following example: Dim myString As String = "ABCDE" Dim myInteger As Integer myInteger = myString.IndexOf("D") ' myInteger = 3 In the previous example, the IndexOf method of myString was used to return the index corresponding to the first instance of the character "C" in the string. IndexOf is an overloaded method, and the other overloads provide methods to search for any of a set of characters, or to search for a string within your string, among others. The Visual Basic .NET command InStr also allows you to perform similar functions. For more information of these methods, see String.IndexOf Method and InStr Function. You can also use the String.LastIndexOf Method to search for the last occurrence of a character in your string. Creating New Strings from Old When using strings, you may want to modify your strings and create new ones. You may want to do something as simple as convert the entire string to uppercase, or trim off trailing spaces; or you may want to do something more complex, such as extracting a substring from your string. The System.String class provides a wide range of options for modifying, manipulating, and making new strings out of your old ones. To combine multiple strings, you can use the concatenation operators (& or +). You can also use the String.Concat Method to concatenate a series of strings or strings contained in objects. An example of the String.Concat method follows: You can convert your strings to all uppercase or all lowercase strings using either the Visual Basic .NET functions UCase Function and LCase Function or the String.ToUpper Method and String.ToLower Method methods. An example is shown below: Dim myString As String = "UpPeR oR LoWeR cAsE" Dim newString As String ' newString = "UPPER OR LOWER CASE" newString = UCase(myString) ' newString = "upper or lower case" newString = LCase(myString) ' newString = "UPPER OR LOWER CASE" newString = myString.ToUpper ' newString = "upper or lower case" newString = myString.ToLower The String.Format method and the Visual Basic .NET Format command can generate a new string by applying formatting to a given string. For information on these commands, see Format Function or String.Format Method. You may at times need to remove trailing or leading spaces from your string. For instance, you might be parsing a string that had spaces inserted for the purposes of alignment. You can remove these spaces using the String.Trim Method function, or the Visual Basic .NET Trim function. An example is shown: Dim spaceString As String = _ " This string will have the spaces removed " Dim oneString As String Dim twoString As String ' This removes all trailing and leading spaces. oneString = spaceString.Trim ' This also removes all trailing and leading spaces. twoString = Trim(spaceString) If you only want to remove trailing spaces, you can use the String.TrimEnd Method or the RTrim function, and for leading spaces you can use the String.TrimStart Method or the LTrim function. For more details, see LTrim, RTrim, and Trim Functions functions. The String.Trim functions and related functions also allow you to remove instances of a specific character from the ends of your string. The following example trims all leading and trailing instances of the "#" character: Dim myString As String = "#####Remove those!######" Dim oneString As String OneString = myString.Trim("#") You can also add leading or trailing characters by using the String.PadLeft Method or the String.PadRight Method. If you have excess characters within the body of your string, you can excise them by using the String.Remove Method, or you can replace them with another character using the String.Replace Method. For example: Dim aString As String = "This is My Str@o@o@ing" Dim myString As String Dim anotherString As String ' myString = "This is My String" myString = aString.Remove(14, 5) ' anotherString = "This is Another String" anotherString = myString.Replace("My", "Another") You can use the String.Replace method to replace either individual characters or strings of characters. The Visual Basic .NET Mid Statement can also be used to replace an interior string with another string. You can also use the String.Insert Method to insert a string within another string, as in the following example: Dim aString As String = "This is My Stng" Dim myString As String ' Results in a value of "This is My String". myString = aString.Insert(13, "ri") The first parameter that the String.Insert method takes is the index of the character the string is to be inserted after, and the second parameter is the string to be inserted. You can concatenate an array of strings together with a separator string by using the String.Join Method. Here is an example: Dim shoppingItem(2) As String Dim shoppingList As String shoppingItem(0) = "Milk" shoppingItem(1) = "Eggs" shoppingItem(2) = "Bread" shoppingList = String.Join(",", shoppingItem) The value of shoppingList after running this code is "Milk,Eggs,Bread". Note that if your array has empty members, the method still adds a separator string between all the empty instances in your array. You can also create an array of strings from a single string by using the String.Split Method. The following example demonstrates the reverse of the previous example: it takes a shopping list and turns it into an array of shopping items. The separator in this case is an instance of the Char data type; thus it is appended with the literal type character c. The Visual Basic .NET Mid Function can be used to generate substrings of your string. The following example shows this functions in use: Dim aString As String = "Left Center Right" Dim rString, lString, mString As String ' rString = "Right" rString = Mid(aString, 13) ' lString = "Left" lString = Mid(aString, 1, 4) ' mString = "Center" mString = Mid(aString, 6,6) Substrings of your string can also be generated using the String.Substring Method. This method takes two arguments: the character index where the substring is to start, and the length of the substring. The String.Substring method operates much like the Mid function. An example is shown below: There is one very important difference between the String.SubString method and the Mid function. The Mid function takes an argument that indicates the character position for the substring to start, starting with position 1. The String.SubString method takes an index of the character in the string at which the substring is to start, starting with position 0. Thus, if you have a string "ABCDE", the individual characters are numbered 1,2,3,4,5 for use with the Mid function, but 0,1,2,3,4 for use with the System.String function. Vb.net 1036 09/09/2023 Vb.net Variables Create New Arrays array null Read through entire array For Each fruit As String In MV Console.WriteLine(fruit) Next max number of elements array.length For L = 0 To MV.GetUpperBound(0) elements stored Either Dim strings = New String() {"a", "b", "c"} or Dim strings() As String = {"a", "b", "c"} or strings() As String = {} should work Vb.net 2 09/09/2023 VBscript Function Open An Application Like Notepad And File Using Your Browser load application PhpScript INI WSFTP INI ftpClient INI CopyFiles INI Macromedia INI VBscript 1547 09/09/2023 Windows <=8 Customizing Creating Your Own Menu Using The Windows Toolbar toolbar too bar desktop desk top right click folder task bar Even though it is cool using the bricks in the start menu I still like putting my favorite apps on the windows task bar without pinning. It takes up a lot less space. To do this: Right click on the desk top and create a new folder. Give it a Short name so it does not take up much space on the tool bar I like my desk top clean so I just dragged and dumped everything I use a lot on this folder. You will need to copy and paste if you want an icon to stay on the desk top. Leave the folder on your desktop. Right click on the task bar and click on toolbars-new toolbar. From the dialogue box select the Desktop. Select the file folder that you named. You now have all your favorites on the task bar. After you reboot the will be list by alpha. Windows <=8 1296 09/09/2023 Windows <=8 Customizing Making Changes To Your Computer auto dim pc settings control panel Like windows 7 you can use the control panel to adjust the power management and hardware settings. Windows 8 has the PC Settings in the right bar under "SETTINGS" that also has options. My Samsung computer would dim every time it would boot up and I would take it to the place I bought and could not create it. After several hours of frustration I found an auto dim setting that I unchecked. Make sure you look here also Windows <=8 1916 09/09/2023 Windows <=8 Customizing Updating To Windows 10 windows 10 update My computer does not give me the option to update to 10. I found this link which may help. https://www.microsoft.com/en-us/software-download/windows10 Windows <=8 888 09/09/2023 Windows <=8 Customizing To Increase Virtual Memory In Windows 8.1 virtual memory performance Windows To increase virtual memory in Windows 8.1, open System Properties, go to the Advanced tab, click Settings under Performance, then click Change under Virtual Memory. Uncheck Automatically manage paging file size for all drives, select your desired drive, choose Custom size, and input an Initial size (MB) and Maximum size (MB). A common recommendation is an initial size of 1.5 times your RAM and a maximum size of 3 times your RAM, converted to MB (1 GB = 1024 MB). Click Set, then OK, and restart your computer for the changes to take effect. Step-by-step guide to increase virtual memory in Windows 8.1: 1. Access System Properties: Press the Windows key + X and select System, or right-click on "Computer" (or "This PC") and select Properties. 2. Navigate to Advanced System Settings: In the System window, click on Advanced system settings on the left-hand side. 3. Open Advanced -> Performance -> Settings: In the System Properties dialog box, go to the Advanced tab and click the Settings button under the Performance section. Access Virtual Memory Settings: In the Performance Options window, go to the Advanced tab, then click the Change button under the Virtual memory section. Disable Automatic Management: Uncheck the box that says "Automatically manage paging file size for all drives". Set Custom Size: Select your desired drive (usually the C: drive) and choose the "Custom size" option. Enter Initial and Maximum Sizes: In the Initial size (MB) and Maximum size (MB) fields, enter your desired values. -- Recommendation: Set the initial size to 1.5 times your installed RAM and the maximum size to 3 times your installed RAM. -- Conversion: Remember that 1 GB is equal to 1024 MB. Apply and Confirm: Click Set, then OK to close the Performance Options window, and click OK again to close the System Properties window. Restart Your Computer: A restart is required for the new virtual memory settings to take effect. Windows <=8 1 09/14/2025 Windows <=8 Files Register Ocx register ocx dll MSINET.OCX for 64 bit Windows 7 & Vista : AngryByteSep 9, 2010 ... MSINET.OCX is a file required by many old application in order to ... in the command prompt type: “regsvr32 c:\windows\syswow64\MSINET.OCX” MSINET.OCX is a file required by many old application in order to parse HTML pages . This OCX will not register as most of know, by putting in in the system32 folder and typing the command “regsvr32 MSINET.OCX”. With newer 64 bit systems it is a bit tricky. Here is how to do it 1. download the file here 2. Copy it to c:\windows\syswow64 3. type the following “Run” command “CMD” then right click the command prompt search result and hit “run as administrator”, in the command prompt type: “regsvr32 c:\windows\syswow64\MSINET.OCX” and yes, you must type the full path to the file, not just the name. 4. That’s it it should work now. Windows <=8 1650 09/09/2023 Windows <=8 Files Short Filenames dos short file names Folders: There is Microsoft's algorithm, for converting a regular (long) filename to a DOS (short) filename, which you can probably find on MSDN. The most basic operation is indeed to construct an "8.3" abbreviation by appending "~1" to the first 6 chars, then dropping everything else, up to the first (?) ".", and taking only the first 3 chars after that, for the "extension". But the algorithm continues, if you have a lot of files with similar names, for instance (after you run out of "~2", "~3", ...). But then, there is the entirely different operation, of taking a directory in a FAT32/NTFS filesystem, and getting the actual (short and long) names stored for the files in it (as in "DIR /X"), IF the filesystem has generated a short name for each file (I think in the NTFS version used in WindowsXP, the short name is no longer generated and stored, by default, for every file?). So, using Microsoft's algorithm you can predict what the short name should be, but retrieving the actual short name from the directory is a different operation. The two should match, except in the newer filesystems e.g. NTFS under WinXP, where there may no longer be a short name stored for a given file (I think you can still create and store the short name for a given file, on demand if needed?). Files: Windows supports long file names up to 255 characters in length. Windows also generates an MS-DOS-compatible (short) file name in 8.3 format to allow MS-DOS-based or 16-bit Windows-based programs to access the files. MORE INFORMATIONWindows generates short file names from long file names in the following manner:...Windows generates short file names from long file names in the following manner: Windows deletes any invalid characters and spaces from the file name. Invalid characters include: . " / \ [ ] : ; = , Because short file names can contain only one period (.), Windows removes additional periods from the file name if valid, non-space characters follow the final period in the file name. For example, Windows generates the short file name Thisis~1.txt from the long file name This is a really long filename.123.456.789.txt Otherwise, Windows ignores the final period and uses the next to the last period. For example, Windows generates the short file name Thisis~1.789 from the long file name This is a really long filename.123.456.789. Windows truncates the file name, if necessary, to six characters and appends a tilde (~) and a digit. For example, each unique file name created ends with "~1." Duplicate file names end with "~2," "~3," and so on. Windows truncates the file name extension to three characters or less. Windows translates all characters in the file name and extension to uppercase. Note that if a folder or file name contains a space, but less than eight characters, Windows still creates a short file name. This behavior may cause problems if you attempt to access such a file or folder over a network. To work around this situation, substitute a valid character, such as an underscore (_), for the space. If you do so, Windows does not create a different short file name For example, "Afile~1.doc" is generated from "A file.doc" because the long file name contains a space. No short file name is generated from "A_file.doc" because the file name contains less than eight characters and does not contain a space. The short file name "Alongf~1.txt" is generated from the long file name "A long filename.txt" because the long file name contains more than eight characters. -------------------------------------------------------------------------------- Windows <=8 2443 09/09/2023 Windows <=8 Files How To View The Contents Of The Clipboard clipboard The Windows clipboard is where the text, graphics, etc. that you cut or copy reside, waiting for you to paste them to another location. In Windows XP, it was easy to view the contents of the clipboard with clipbrd.exe, but Microsoft removed that feature in Vista and Windows 7, due to security concerns. However, you can copy the file from an XP computer and install it on Vista or Windows 7. Here's how: On the XP computer, right click Start, click Explore and navigate to: C: \ Windows \ System32 Find the file named clipbrd.exe and copy it to a USB thumb drive or a location on the network that's accessible to the Vista/Windows 7 computer. Now on the Vista/Windows 7 computer, copy it to that computer's System32 folder. Note: If you can't see the System32 folder, in Explorer first click Organize | Layout and check "Menu Bar" to display the menu bar, then click Tools | Folder Options, click the View tab, and under Advanced Settings, scroll down and check the option to "Show hidden files, folders and drives." Then uncheck the option to "Hide protected operating system drives (recommended) and click "Yes" when asked if you're sure you want to do this. Windows <=8 1855 09/09/2023 Windows <=8 Files System Restore Points Are Deleted When You Restart Your Windows 7 Comp system restore points delete System Restore can be a lifesaver - but only if you have a restore point when you need it. What if you restart the computer and find that your restore points are now gone? You can create new ones - but if you restart the system again, poof! They disappear, too! What's up with that? Well, it might be that the maxium storage size limit for shadow storage is set too low. Find out how to fix it, in KB article 2506576. To resolve this issue, adjust the maximum shadow storage allocation. To do this, follow the steps listed below: Click Start, type System in the Search box and then click System from the list under Control panel Click System protection in the task pane Under Protection Settings click to select Local Disk (C:) (System) and then click Configure Under Disk Space Usage, move the Max Usage slider to the right to increase the disk space usage for System Restore points Note: If protection is turned on for additional drives you might consider increasing the Max Usage for those drives as well. Back to the top MORE INFORMATIONWhen the issue happens, one or more of the following events might be logged in t...When the issue happens, one or more of the following events might be logged in the Event log: Event ID 25: The shadow copies of volume C: were deleted because the shadow copy storage could not grow in time. Consider reducing the IO load on the system or choose a shadow copy storage volume that is not being shadow copied." Event ID 22: Volume Shadow Copy Service error: A critical component required by the Volume Shadow Copy service is not registered. This might happened if an error occurred during Windows setup or during installation of a Shadow Copy provider. The error returned from CoCreateInstance on class with CLSID {e579ab5f-1cc4-44b4-bed9-de0991ff0623} and Name IVssCoordinatorEx2 is [0x80040154, Class not registered]. Event ID 8193: Volume Shadow Copy Service error: Unexpected error calling routine CoCreateInstance. hr = 0x80040154, Class not registered. To increase the size of shadow storage using command prompt commands follow these steps: Open a command prompt with administrative privileges At the command prompt type Vssadmin list shadowstorage Take note of what the shadow storage allocation is on the drive you're having issues with Change the allocation by using the Vssadmin command, syntax: vssadmin resize shadowstorage /On=C: /For=C: /Maxsize=1G (where Maxsize=the amount of disk space you've allocated to System Restore points, you should increase it larger) Then reboot your computer Restore point deletion can also be caused by the following: Some 3rd party disk applications like Diskeeper can cause restore points to be deleted. To test for this issue disable these types of applications to see if it can resolve the problem. Corrupted ACLs for pagefiles.sys and hiberfil.sys can also cause the issue. To test for this issue, disable pagefile and hiberfil on your system, defrag the drive to verify that these files have been deleted and then enable pagefile and hiberfil. Reboot the computer and create restore points and verify that restore points are not deleted over the next few days. Systems with a dual boot with Windows XP will also cause system restore points to be deleted. See KB 926185 (http://support.microsoft.com/kb/926185) for more details. Windows <=8 5196 09/09/2023 Windows <=8 Files How To Remove Programs From The "open With" Menu extensions remove programs Windows XP tries to be helpful. If you open a file with a particular extension using a certain program, it will add that program to the "Open with" right click menu options forever after when you click "Open with." What if you have programs in that menu that you would like to get rid of? Maybe you tried to open a file with the wrong program, and now there it is, stuck in the "Open with" options. Here's how to fix that: First, log on as an administrator and open the registry editor. Back up the registry key you're going to edit, using the Export command in the file menu. Navigate to the following key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts This will display a list of all the file extensions that are registered, shown as folders in the left pane. Scroll down and find the file extension that you want to edit. Click the white arrow beside it to expand the subfolders. Select the subfolder labeled OpenWithList In the right pane, you'll see the names of programs in the Data column. Right click the name of the program you want to remove from the list. Click Delete. At the "Are you sure?" prompt, click Yes. Do this for all programs that you want to remove from the list for this file extension. Close the registry editor. Now the extra programs shouldn't show up when you click the Open With menu. Windows <=8 2072 09/09/2023 Windows <=8 Files How To Change File Sorting Order Of Numbered Files sort number files If you ever create files with numbers as names, you might have noticed that in Windows XP, Explorer will put a file named 2doc.jpg after one that's named 20doc.jpg. One workaround is to put a zero in front of those one-digit numbers, but another solution is to edit the registry to make the sorting of numbers working as you'd expect it to. Here's how: Open your registry editor and navigate to the following location: HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explore Right click in an empty space in the right pane and select New | DWORD value Name the new value NoStrCmpLogical Right click the new item and set its value data to 1 Close the registry editor Windows <=8 1878 09/09/2023 Windows <=8 Files How To Put The "encrypt" Command On The Right Context Menu encrypt files If you find yourself frequently encrypting files and folders with the Encrypting File System (EFS) on XP Professional, you can make it more convenient by adding the Encrypt/Decrypt command to the right-click shortcut menu. Note that it involves editing the registry, so be sure to back it up first. You'll find the instructions in KB article 241121 at http://support.microsoft.com/kb/241121 Windows <=8 1926 09/09/2023 Windows <=8 Files Where Are My Folders? recycle bin contro; panel QUESTION: I just recently upgraded to Windows 7 and I must say I like it a lot. I never thought I would after trying Vista and going back to XP. But one thing I noticed is that in My Computer (when I open Computer in the Start menu), I don't see the folders for the Recycle Bin and Control Panel over in the left pane like I used to. Have these moved and if so to where? Thanks! - Jen L. ANSWER: You're correct that Windows 7 no longer displays these folders in the "Computer" window by default. However, you can change it back to the old way. Click Tools | Folder Options and on the General tab, down at the bottom in the "Navigation Pane" section, check the box that says "Show all folders." Now those folders should show up in your left pane. Windows <=8 1720 09/09/2023 Windows <=8 Files How To Make A Program Always Start In Administrator Mode run as administrator privilages There are some programs, especially tools and utilities, that need to run in administrator mode in order to do what they're intended to do. You can navigate to the executable file, right click it and select to run as administrator each time you want to run it, but that's a bit of a hassle. Instead, you can create a shortcut that you can use to open the program in admin mode every time. Here's how: First, make a shortcut on your desktop or in another location. Right click an empty space on the desktop and click New and then Shortcut. In the Create Shortcut wizard, browse to the location of the executable file and click Next. Give the shortcut a name and then click Finish. Now right click the shortcut and select Properties. Click the Advanced button. Check the box that says "Run as administrator" and click OK. Now just double click the shortcut to start the program and it will automatically run in administrator mode. Windows <=8 2049 09/09/2023 Windows <=8 Files How To Delete Shadow Copies system restore shadow copies Shadow copies are great - this feature in Windows lets you access previous versions of your files and restore them to an earlier point in time. However, when Windows saves many previous versions, they can begin to take up a lot of space on your disk. This is especially troublesome if you're using a modern faster (but lower capacity) solid state drive (SSD). You can delete shadow copies to free up disk space. Here's how: Click Start and in the search box, type disk cleanup. Click the link that appears in the search results. Click "Files from all users on this computer." Enter admin credentials if prompted to do so. Select the hard drive on which the shadow copies are stored if prompted (this selection will appear only if you have multiple drives). Click the More Options tab. Click System Restore and Shadow Copies, then click OK. Press the Delete key to verify that you want to delete the restore and shadow copies. If you're really pressed for space and don't want Windows shadow copies: It is not recommended to turn off Volume Shadow Copy. It manages and implements Volume Shadow Copies used for backup and other purposes. If this service is stopped, shadow copies will be unavailable for backup and the backup may fail. If this service is disabled, any services that explicitly depend on it will fail to start. Let us know if there is some issue that you are facing because of Volume Shadow Copy, so that we can help you troubleshoot the issue. However, if you still want to disable Volume shadow copy than follow the steps as below: 1. Click on Start, type services and press enter. 2. Locate the service "Volume Shadow Copy" and right click and click "Stop". 3. Close Services windows. Reference link (Applicable for Windows 7): http://windows.microsoft.com/en-US/windows-vista/Manage-services-in-Windows-Vista-from-Windows-Vista-Inside-Out Windows <=8 1503 09/09/2023 Windows <=8 Files Removing Admin Rights Protects Against Most Vulnerabilities administrator privilages According to a study just released by BeyondTrust, which analyzed all new security vulnerabilities published in the 100+ security bulletins Microsoft issued in 2010, simply removing administrative rights from user accounts will mitigate about three fourths of the critical vulnerabilities. Windows <=8 2162 09/09/2023 Windows <=8 Files How To Disable The Automatic Desktop Cleanup Wizard desktop wizard One of the features that was new to XP was the automatic desktop cleanup wizard. The idea was to track how often you used each of the icons on your desktop, and get rid of those you seldom used, to keep the desktop free of clutter. It might sound like a good idea, but if you don't like the idea of icons disappearing, you can turn the feature off. Here's how: Right click an empty area on the desktop. Click Properties and select Display Properties. Click the Desktop tab. Click Customize Desktop. In the Desktop Items dialog box, clear the checkbox labeled "Run Desktop Wizard every 60 days." Click OK to close the dialog boxes. You can still run the wizard manually whenever you want, by clicking "Clean Desktop Now" in the Desktop Items dialog box. Windows <=8 2130 09/09/2023 Windows <=8 Files How To Change The Sort Order Of Files And Folders In Window Apps windows applications sort order The Open and Save dialog boxes in applications such as Notepad, WordPad, etc. display files and folders sorted by name, in ascending order. Folders are on top and then files. Did you know you can change this permanently? Here's how: Open one of these dialog boxes. Change the sort order (for instance, to display chronologically). Hold down the CTRL key while you close the dialog box by clicking Save or Open, or by clicking the X in the upper right corner. This causes the new sort order preference to be written to the registry, so that all such dialog boxes for built in Windows applications (not separate applications such as Office) will use it every time. This change will only apply to the logged-on user, not to everyone who uses the computer. Windows <=8 2190 09/09/2023 Windows <=8 Files FOLDER PATHS folder paths onedrive dropbox one drive drop box USING steve as a user version 11 C:UserssteveOneDrivewww C:Dropbox 'available to all users Windows <=8 2 09/09/2023 Windows <=8 Formatting How To Change The Categories Arrangement In Control Panel classic view control panel Personally, I don't like the Categories view of Control Panel; I always immediately switch back to the "Classic" Control Panel view. But some folks find the categorization useful - yet don't necessarily agree that Microsoft has put everything into the right category. Well, if you're brave enough to venture into the registry, you can actually assign a different category to a Control Panel item. Here's how: In your registry editor, navigate to the following key: HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Control Panel \ Extended Properties \ {305CA226-D286-468e-B848-2B2E8E697B74} 2 Now in the right pane, find the item that you want to recategorize. Double click it to bring up its properties box. Change the DWORD value to the number that corresponds to the category where you want to place it. See the list below for the numbers for each category. Other Control Panel Options - 0 Appearance and Themes - 1 Printers and other Hardware - 2 Network and Internet Connections - 3 Sounds, Speed and Audio Devices - 4 Performance and Maintenance - 5 Date, Time, Language and Regional Options - 6 Accessibility Options - 7 Add or Remove Programs - 8 User Accounts - 9 Windows <=8 1601 09/09/2023 Windows <=8 Formatting New Theme Changed My Icons themes icons desktop QUESTION: I don't know if there's a way to have what I want but here goes. I had some custom icons on my desktop that I really liked. I changed to a different theme and it changed those icons too. Is there a way to apply the new theme but keep my custom icons? Just curious. - Elton D. ANSWER: Luckily, this is an easy fix. Right click an empty space on the desktop and select Personalize. Over in the left pane of the dialog box, click Change Desktop Icons. Now down at the bottom of that dialog box, uncheck the box that says "Allow themes to change desktop icons." Windows <=8 1765 09/09/2023 Windows <=8 Formatting Unable To Change Desktop Background In Windows 7 background wallpaper You want to change your desktop background (wallpaper) to something else. That's simple enough, right? But sometimes you might encounter this situation: when you try to do it through Control Panel (Appearance and Personalization | Change Desktop Background), the check boxes aren't selected when you click them and the Select All and Clear All buttons don't work, either. So you try to right click a picture in Explorer and choose Set as Desktop Background, but you get a message saying the image can't be set as wallpaper because an internal error occurred. What's going on here? Well, there are actually several issues that can cause this problem. You'll find methods for resolving them in KB article 2504610 at http://www.win7news.net/R3JAT1/110217-MS-Support-2504610 Windows <=8 1256 09/09/2023