mirror of
https://github.com/EverythingWindows/ShiftOS-TheRevival-Old.git
synced 2025-01-22 18:02:16 +00:00
Rename function implemented
This commit is contained in:
parent
e73d05d3b0
commit
1d1722345b
6 changed files with 68 additions and 16 deletions
|
@ -264,9 +264,15 @@
|
||||||
NormalCommand()
|
NormalCommand()
|
||||||
End If
|
End If
|
||||||
Case "time"
|
Case "time"
|
||||||
Terminal_Time()
|
If Strings.AvailableFeature(5) = 1 Then
|
||||||
AdvancedCommand = False
|
Terminal_Time()
|
||||||
NormalCommand()
|
AdvancedCommand = False
|
||||||
|
NormalCommand()
|
||||||
|
ElseIf Strings.AvailableFeature(5) = 3 Then
|
||||||
|
Terminal_Time()
|
||||||
|
AdvancedCommand = False
|
||||||
|
NormalCommand()
|
||||||
|
End If
|
||||||
Case "su"
|
Case "su"
|
||||||
Terminal_Su()
|
Terminal_Su()
|
||||||
AdvancedCommand = False
|
AdvancedCommand = False
|
||||||
|
@ -340,6 +346,13 @@
|
||||||
AdvancedCommand = False
|
AdvancedCommand = False
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
If command Like "ren '*' '*'" Then
|
||||||
|
If Strings.AvailableFeature(31) = 1 Then
|
||||||
|
Rename()
|
||||||
|
NormalCommand()
|
||||||
|
AdvancedCommand = False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
If command Like "rev *" Then
|
If command Like "rev *" Then
|
||||||
If Strings.AvailableFeature(21) = 1 Then
|
If Strings.AvailableFeature(21) = 1 Then
|
||||||
Reverse()
|
Reverse()
|
||||||
|
|
|
@ -5,12 +5,16 @@ Module FileManagement
|
||||||
If File.Exists(Console.CurrentDirectory & "\" & filename) = True Then
|
If File.Exists(Console.CurrentDirectory & "\" & filename) = True Then
|
||||||
Dim ContentsFinal As String = File.ReadAllText(Console.CurrentDirectory & "\" & filename)
|
Dim ContentsFinal As String = File.ReadAllText(Console.CurrentDirectory & "\" & filename)
|
||||||
NewLine(ContentsFinal)
|
NewLine(ContentsFinal)
|
||||||
|
Else
|
||||||
|
NewLine("File is not exist")
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub DeleteFile(filename As String)
|
Public Sub DeleteFile(filename As String)
|
||||||
If File.Exists(Console.CurrentDirectory & "\" & filename) = True Then
|
If File.Exists(Console.CurrentDirectory & "\" & filename) = True Then
|
||||||
File.Delete(Console.CurrentDirectory & "\" & filename)
|
File.Delete(Console.CurrentDirectory & "\" & filename)
|
||||||
|
Else
|
||||||
|
NewLine("File is not exist")
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@
|
||||||
'28 = Date by month and year [Shows date in MM/YYYY format] (0.2.5) (default : 0)
|
'28 = Date by month and year [Shows date in MM/YYYY format] (0.2.5) (default : 0)
|
||||||
'29 = Date by general [Shows date in general DD/MM/YYYY format] (0.2.5) (default : 0)
|
'29 = Date by general [Shows date in general DD/MM/YYYY format] (0.2.5) (default : 0)
|
||||||
'30 = Batch-file support for ShiftOS [Gives execution support for ShiftOS Script File (.scr)] (0.2.5) (default : 0)
|
'30 = Batch-file support for ShiftOS [Gives execution support for ShiftOS Script File (.scr)] (0.2.5) (default : 0)
|
||||||
'31 = Clipboard support for ShiftOS [Gives clipboard support for copy-pasting in ShiftOS] (0.2.6) (default : 0)
|
'31 = Rename support [Ability to rename files in ShiftOS] (default : 0)
|
||||||
'
|
'
|
||||||
'Features bought hierarchy :
|
'Features bought hierarchy :
|
||||||
'ShiftOS Key (KEY) (5 CP)
|
'ShiftOS Key (KEY) (5 CP)
|
||||||
|
@ -100,8 +100,8 @@
|
||||||
'>>>>>>RGB Variant (rgb2) (75 CP)
|
'>>>>>>RGB Variant (rgb2) (75 CP)
|
||||||
'>>>>>>>4-bit Color Display (4BITCOLOR) (80 CP)
|
'>>>>>>>4-bit Color Display (4BITCOLOR) (80 CP)
|
||||||
'>>>>>>>>Terminal Read-Only Memory Driver (ROMDRIVER, DIR, MKDIR, RMDIR, CD, PWD) (90 CP)
|
'>>>>>>>>Terminal Read-Only Memory Driver (ROMDRIVER, DIR, MKDIR, RMDIR, CD, PWD) (90 CP)
|
||||||
|
'>>>>>>>>>Rename support (RENAME) (95 CP)
|
||||||
'>>>>>>>>>TextPad (100 CP)
|
'>>>>>>>>>TextPad (100 CP)
|
||||||
'>>>>>>>>>>Clipboard support (CLIPBOARD) (100 CP)
|
|
||||||
'>>>>>>>>>>ShiftOS Batch Script Support (BATCHSCRIPT) (100 CP)
|
'>>>>>>>>>>ShiftOS Batch Script Support (BATCHSCRIPT) (100 CP)
|
||||||
'>>Basic Calculator (BC) (55 CP)
|
'>>Basic Calculator (BC) (55 CP)
|
||||||
'>>Time by Seconds (TIME, STIME) (10 CP)
|
'>>Time by Seconds (TIME, STIME) (10 CP)
|
||||||
|
|
|
@ -55,9 +55,9 @@
|
||||||
If Strings.AvailableFeature(30) = "0" Then
|
If Strings.AvailableFeature(30) = "0" Then
|
||||||
NewLine("(batchscript | 100 CP) ShiftOS Batch Script Support")
|
NewLine("(batchscript | 100 CP) ShiftOS Batch Script Support")
|
||||||
End If
|
End If
|
||||||
If Strings.AvailableFeature(31) = "0" Then
|
End If
|
||||||
NewLine("(clipboard | 100 CP) Clipboard support")
|
If Strings.AvailableFeature(31) = "0" Then
|
||||||
End If
|
NewLine("(rename | 95 CP) Rename command")
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
@ -381,13 +381,13 @@
|
||||||
NewLine(ManHeader(1))
|
NewLine(ManHeader(1))
|
||||||
NormalCommand()
|
NormalCommand()
|
||||||
End If
|
End If
|
||||||
Case "clipboard"
|
Case "rename"
|
||||||
If Strings.AvailableFeature(31) = "0" Then
|
If Strings.AvailableFeature(31) = "0" Then
|
||||||
ManHeader(0) = "Clipboard Support"
|
ManHeader(0) = "Rename command"
|
||||||
ManHeader(1) = "100 CP"
|
ManHeader(1) = "95 CP"
|
||||||
NewLine(ManHeader(0))
|
NewLine(ManHeader(0))
|
||||||
NewLine(Nothing)
|
NewLine(Nothing)
|
||||||
NewLine("Adds the supports for clipboard")
|
NewLine("Gives ability to rename a file")
|
||||||
NewLine(Nothing)
|
NewLine(Nothing)
|
||||||
NewLine(ManHeader(1))
|
NewLine(ManHeader(1))
|
||||||
NormalCommand()
|
NormalCommand()
|
||||||
|
@ -494,8 +494,8 @@
|
||||||
Case "batchscript"
|
Case "batchscript"
|
||||||
Shiftorium_InstallFeatures(True, "batchscript", 30, 100)
|
Shiftorium_InstallFeatures(True, "batchscript", 30, 100)
|
||||||
NormalCommand()
|
NormalCommand()
|
||||||
Case "clipboard"
|
Case "rename"
|
||||||
Shiftorium_InstallFeatures(True, "clipboard", 31, 100)
|
Shiftorium_InstallFeatures(True, "rename", 31, 95)
|
||||||
NormalCommand()
|
NormalCommand()
|
||||||
Case Else
|
Case Else
|
||||||
NormalCommand()
|
NormalCommand()
|
||||||
|
@ -587,11 +587,11 @@
|
||||||
Case "romdriver"
|
Case "romdriver"
|
||||||
Strings.AvailableFeature(16) = "1"
|
Strings.AvailableFeature(16) = "1"
|
||||||
Strings.AvailableFeature(17) = "0"
|
Strings.AvailableFeature(17) = "0"
|
||||||
|
Strings.AvailableFeature(31) = "0"
|
||||||
success = True
|
success = True
|
||||||
Case "textpad"
|
Case "textpad"
|
||||||
Strings.AvailableFeature(17) = "1"
|
Strings.AvailableFeature(17) = "1"
|
||||||
Strings.AvailableFeature(30) = "0"
|
Strings.AvailableFeature(30) = "0"
|
||||||
Strings.AvailableFeature(31) = "0"
|
|
||||||
success = True
|
success = True
|
||||||
Case "shiftkey"
|
Case "shiftkey"
|
||||||
Strings.AvailableFeature(18) = "1"
|
Strings.AvailableFeature(18) = "1"
|
||||||
|
@ -645,7 +645,7 @@
|
||||||
Case "batchscript"
|
Case "batchscript"
|
||||||
Strings.AvailableFeature(30) = "1"
|
Strings.AvailableFeature(30) = "1"
|
||||||
success = True
|
success = True
|
||||||
Case "clipboard"
|
Case "rename"
|
||||||
Strings.AvailableFeature(31) = "1"
|
Strings.AvailableFeature(31) = "1"
|
||||||
success = True
|
success = True
|
||||||
End Select
|
End Select
|
||||||
|
|
|
@ -178,6 +178,7 @@
|
||||||
<Compile Include="TerminalApplications\Internal\Com_Manual.vb" />
|
<Compile Include="TerminalApplications\Internal\Com_Manual.vb" />
|
||||||
<Compile Include="TerminalApplications\Internal\Com_Mkdir.vb" />
|
<Compile Include="TerminalApplications\Internal\Com_Mkdir.vb" />
|
||||||
<Compile Include="TerminalApplications\Internal\Com_Pwd.vb" />
|
<Compile Include="TerminalApplications\Internal\Com_Pwd.vb" />
|
||||||
|
<Compile Include="TerminalApplications\Internal\Com_Rename.vb" />
|
||||||
<Compile Include="TerminalApplications\Internal\Com_Rev.vb" />
|
<Compile Include="TerminalApplications\Internal\Com_Rev.vb" />
|
||||||
<Compile Include="TerminalApplications\Internal\Com_Rmdir.vb" />
|
<Compile Include="TerminalApplications\Internal\Com_Rmdir.vb" />
|
||||||
<Compile Include="TerminalApplications\Internal\Com_Shiftfetch.vb" />
|
<Compile Include="TerminalApplications\Internal\Com_Shiftfetch.vb" />
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
Imports System.IO
|
||||||
|
|
||||||
|
Module Com_Rename
|
||||||
|
Public ShouldRename As Boolean
|
||||||
|
|
||||||
|
Public Sub Rename()
|
||||||
|
Dim Names() As String = command.Split("''")
|
||||||
|
If Names(1) = "" Then
|
||||||
|
NewLine("No filename has been inputted")
|
||||||
|
ShouldRename = False
|
||||||
|
ElseIf Names(1) Like " *" Then
|
||||||
|
NewLine("Filename cannot be started with spaces")
|
||||||
|
ShouldRename = False
|
||||||
|
Else
|
||||||
|
ShouldRename = True
|
||||||
|
End If
|
||||||
|
If Names(3) = "" Then
|
||||||
|
NewLine("No new filename has been inputted")
|
||||||
|
ShouldRename = False
|
||||||
|
ElseIf Names(3) Like " *" Then
|
||||||
|
NewLine("Filename cannot be started with spaces")
|
||||||
|
ShouldRename = False
|
||||||
|
Else
|
||||||
|
ShouldRename = True
|
||||||
|
End If
|
||||||
|
If ShouldRename = True Then
|
||||||
|
If File.Exists(Console.CurrentDirectory & "\" & Names(1)) = True Then
|
||||||
|
FileSystem.Rename(Console.CurrentDirectory & "\" & Names(1), Console.CurrentDirectory & "\" & Names(3))
|
||||||
|
Else
|
||||||
|
NewLine("File is not exist")
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
End Module
|
Loading…
Reference in a new issue