~stuff
22 itemsDownload ./*


..
chatnicks.png
dysphoria-spotify-playlist.url
euphoria-spotify-playlist.url
ffmpeg-gif-record
habitat-spotify-playlist.url
homepage.webm
linux-tools.jpg
new-linux-prep
onedrivesub.vbs
openbox-size-hint-patch
pick-your-drug.url
scrot-video
serenity-spotify-playlist.url
streamit
twily-stream-service
twily.deviantart.url
twily.gif
twily.screenfetch.png
twily.webm
twilypastes.url
unicode_list
water_fantasy_art_artwork_huts_2560x1440_....


stuffonedrivesub.vbs
3 months agoDownloadRawClose


' Author:      Twily aka Analie 2018
' Description: Make Windows OneDrive folder and subfolders accessible from Linux system.
'              Run this script before powering off Windows, then boot Linux!
'              (Untested: can also be scheduled to run on Windows login).
'              NB: Depending on how many files, it may take a bit to complete (Personal
'              estimation on own computer; 30 seconds for 2000 entries).

'On Error Resume Next

Dim PATH, TEMP, STR, BATCH, EXEC, ACTION
PATH = "C:\Users\awv\OneDrive"
TEMP = "C:\TEMP\ONEDRIVESUB.TXT"
EXEC = "C:\TEMP\ONEDRIVESUB.BAT"
BATCH = "@ECHO OFF" & vbNewLine & "CLS" & vbNewLine & "fsutil reparsepoint delete """ & PATH & """" & vbNewLine

Set WshShell = WScript.CreateObject("WScript.Shell")
'Return = WshShell.Run("CMD /C DIR """ & PATH & """ /S /AD /B > """ & TEMP & """",0,True)
Return = WshShell.Run("CMD /C DIR """ & PATH & """ /S /B > """ & TEMP & """",0,True)

Set FSO = CreateObject("Scripting.FileSystemObject")

Set FILE = FSO.OpenTextFile(TEMP)
Do Until FILE.AtEndOfStream
	STR = FILE.ReadLine
	
	If VarType(STR) = 8 Then
		If STR <> "" Then
			BATCH = BATCH & "fsutil reparsepoint delete """ & STR & """" & vbNewLine
		End If
	End If
Loop
FILE.Close

If FSO.FileExists(TEMP) Then
	FSO.DeleteFile TEMP
End If

Set FILE = FSO.CreateTextFile(EXEC,True)
FILE.Write BATCH
FILE.Close

Return = WshShell.Run("CMD /C """ & EXEC & """",0,True)

If FSO.FileExists(EXEC) Then
	FSO.DeleteFile EXEC
End If

'WScript.Echo "Done (OneDrive reparse point):" & vbNewLine & vbNewLine & """" & PATH & """ and all its content have had their reparsepoint deleted, you can now access from linux!"
ACTION = MsgBox("OneDrive reparse point deletion is completed." & vbNewLine & vbNewLine & "Do you wish to reboot your computer now?", vbQuestion + vbYesNo , "OneDrive Reparse Points Deleted")
Select Case ACTION
	Case vbYes
		Return = WshShell.Run("CMD /C SHUTDOWN /R /T 0",0,True)
	Case vbNo
End Select

WScript.Quit

Top
amaliestar at live dot no
©twily.info 2013 - 2019



1 171 250 visits
... ^ v