From bafec65375b29e2729050803d74ab46d24f45575 Mon Sep 17 00:00:00 2001 From: Yudi Date: Sat, 13 Oct 2018 18:40:54 -0300 Subject: [PATCH] Created Scheduling exports on Windows (markdown) --- Scheduling-exports-on-Windows.md | 82 ++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 Scheduling-exports-on-Windows.md diff --git a/Scheduling-exports-on-Windows.md b/Scheduling-exports-on-Windows.md new file mode 100644 index 0000000..96b4c63 --- /dev/null +++ b/Scheduling-exports-on-Windows.md @@ -0,0 +1,82 @@ +We'll be using [DiscordChatExporter Cli](https://github.com/Tyrrrz/DiscordChatExporter/releases/latest) for this Guide. +# + +**1.** Open a text editor such as Notepad and paste: +``` +# Info: https://github.com/Tyrrrz/DiscordChatExporter/wiki + +$TOKEN = "" +$TOKENTYPE = "" +$CHANNEL = "" +$EXEPATH = "" +$FILENAME = "" +$EXPORTDIRECTORY = "" +$EXPORTFORMAT = "" +# Available export formats: PlainText, HtmlDark, HtmlLight, Csv + +cd $EXEPATH + +If($TOKENTYPE -match "BOT"){$ISBOTYES = "-b"} +Else{$ISBOTYES = ""} +.\DiscordChatExporter.Cli.exe export -t $TOKEN $ISBOTYES -c $CHANNEL -f $EXPORTFORMAT -o exporttmp + +$Date = Get-Date -Format "yyyy-MMM-dd HH-mm" + +If($EXPORTFORMAT -match "PlainText"){mv exporttmp -Destination "$EXPORTDIRECTORY\$FILENAME-$Date.txt"} +ElseIf($EXPORTFORMAT -match "HtmlDark"){mv exporttmp -Destination "$EXPORTDIRECTORY\$FILENAME-$Date.html"} +ElseIf($EXPORTFORMAT -match "HtmlLight"){mv exporttmp -Destination "$EXPORTDIRECTORY\$FILENAME-$Date.html"} +ElseIf($EXPORTFORMAT -match "Csv"){mv exporttmp -Destination "$EXPORTDIRECTORY\$FILENAME-$Date.csv"} +exit +``` + +**2.** Replace: + + `` with your [Token](https://github.com/Tyrrrz/DiscordChatExporter/wiki/Obtaining-Token-and-Channel-IDs) + + `` If the Token is from a bot replace it with `BOT`, if it's from a user, `USER` + + `` with a [Channel ID](https://github.com/Tyrrrz/DiscordChatExporter/wiki/Obtaining-Token-and-Channel-IDs) + + `` with the .exe directory path (e.g. C:\Users\User\Desktop\DiscordChatExporter) + + `` with a filename without spaces + + `` with the export directory (e.g. C:\Users\User\Documents\Exports) + + `` with one of the available export formats + + Make sure not do delete the quotes (") + +**3.** Save the file as `filename.ps1` not `.txt` + + +## Export at Startup + +**1.** Press Windows + R, type `shell:startup` and press ENTER + +**2.** Paste `filename.ps1` or a shortcut to this folder + + +## Scheduling with Task Manager + +Please notice your computer must be turned on so the exportation can occur. + +**1.** Press Windows + R, type `taskschd.msc` and press ENTER + +**2.** Select `Task Scheduler Library`, create a Basic Task and follow the instructions on-screen + + + +[ ![](https://i.imgur.com/m2DKhA8.png) ](https://i.imgur.com/3gHkF0t.png) + +**3.** At 'Start a Program', write `powershell -file "C:\path\to\filename.ps1"` in Program/script text box + +![](https://i.imgur.com/FGtWRod.png) + +**4.** Click 'Yes' + +![](https://i.imgur.com/DuaRBt3.png) + +**5.** Click 'Finish' + +![](https://i.imgur.com/LHgXp9Q.png) \ No newline at end of file