Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Batch to save command in same directory

If the batch script run from USB drive then below command saves the text file to USB drive and folder batch script executed from.



Code
@Echo Off & Cls
Tasklist > list.txt

Below command ask you to enter the USB drive letter and saves the text fie to USB drive

Code
@Echo Off
:Start
Cls
@Echo.
@Echo.
@Echo Please Enter the USB Drive Letter. (X) & Set /p DriveLetter=^>
If "%DriveLetter%"=="" Goto :Start
Tasklist > %DriveLetter:~0,1%:\List.txt
(Mar 18, 2016 01:30 AM)FULLAUTO Wrote:  unfortunately it dont save anything, the command seems to need a directory and thats the problem (tested WIN10)
Copy the batch file to USB drive and execute the batch file from USB drive. Batch script works if you follow my instructions. I also tested on Windows 10 and batch script will run on almost all version of Windows O/S. I'm sorry i should have ask earlier do you know how to create a batch file? One second i just notice one command i should have add to batch script try below commands.

Code
@Echo Off & Cls
Cd %~dp0
Tasklist > List.txt
(Mar 18, 2016 02:38 AM)FULLAUTO Wrote:  I know how to use batches and bitches

your second command works fine and as i want it to work... thanks for your time and the very simple solution 🤝🤝🤝🤝
You are very welcome, happy to help you out.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by NarrateDec 25, 2015 02:52 AM 4 186 Dec 25, 2015 02:52 AM
Last Post: Author
by ENGR.OSMONDSep 5, 2011 12:23 PM 1 65 Sep 5, 2011 12:23 PM
Last Post: TickTockMan