saibot559 Posted May 9, 2010 Share Posted May 9, 2010 void setup() { WindowsCommandRun("cmd"); delay(1000); ExecuteCommand("ipconfig"); delay(1000); EditCMD(KEY_S); delay(1000); EditCMD(KEY_Y); delay(1000); ExecuteCommand("exit"); delay(1000); WindowsCommandRun("notepad.exe"); delay(1000); Keyboard.print("Ducky was here, and found an ip-config:"); delay(1000); KeyCombo(MODIFIERKEY_CTRL,KEY_V); KeyCombo(MODIFIERKEY_CTRL,KEY_S); delay(1000); Keyboard.print("Ip-config File"); delay(1000); KeyPress(KEY_ENTER); delay(1000); KeyCombo(MODIFIERKEY_ALT,KEY_F4); delay(1000); } void loop(){} void WindowsCommandRun(char *SomeCommand) { KeyCombo(MODIFIERKEY_GUI,KEY_R); delay(1000); Keyboard.print(SomeCommand); KeyPress(KEY_ENTER); } void KeyPress(int SomeKey) { Keyboard.set_key1(SomeKey); Keyboard.send_now(); ClearKeys(); } void KeyCombo(int ModKey,int SomeKey) { Keyboard.set_modifier(ModKey); Keyboard.set_key1(SomeKey); Keyboard.send_now(); ClearKeys; } void ExecuteCommand(char *SomeCommand) { Keyboard.print(SomeCommand); delay(500); KeyPress(KEY_ENTER); } void ClearKeys() { Keyboard.set_modifier(0); Keyboard.set_key1(0); Keyboard.set_key2(0); Keyboard.set_key3(0); Keyboard.send_now(); } void EditCMD(int SomeKey) { KeyCombo(MODIFIERKEY_ALT,KEY_SPACE); KeyPress(KEY_E); KeyPress(SomeKey); } This code copy's the Ip-config found with CMD to a notepad file and then saves it as an text file on the desktop. and although this might not be that usefull it does show the possibility of copying and pasting inside CMD. I only tested it in XP but it should work on all windows boxes. Quote Link to comment Share on other sites More sharing options...
Sl45h3R Posted May 9, 2010 Share Posted May 9, 2010 WindowsCommandRun("ipconfig > ipconfig.txt"); Quote Link to comment Share on other sites More sharing options...
BITS1 Posted July 7, 2010 Share Posted July 7, 2010 (edited) WindowsCommandRun("ipconfig > ipconfig.txt"); Hi! Do you have any codes that can have the teensy store that file to an external drive? Since we could attach an SD card to the Teensy, I think we could come up with codes that can obtain documents and storing it on the memory card. Thanks! Bits1 Edited July 7, 2010 by BITS1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.