Thanks for your fast reply.
Unfortunately none of these solutions work. They leave errors too numerous to mention.
I had seen two of the solutions before so I will make another search of the internet.
Once again, thanks for your reply!
Since Brian made a Tutorial at the beginning of this month about How to Automate Diskpart, the solutions he gave me using Batch Files did not work for me.
However, I have made an attempt to write a small script, using Windows Powershell, which does work but obviously needs work doing to it!
The first USB which I plug into my desktop PC is always "DriveLetter I", and is the 6th disk on the "List Disk" output list, select "DiskNumber 5".
I have placed a "Pause" in the script to allow the list of disks to be read, please see attachment showing the screen output in blue and the script, as follows:-
[attachment=3499]
This script formats the USB in FAT32, I have another .ps1 file formatting in NTFS
This Powershell language is not like Batch files and I can't find any menu options to try to merge the two scripts and create variables for DriveLetter, DiskNumber and Format (FAT32 or NTFS) and Disk Label.
Just thought you may be able to help in creating a script which will do everything!!!
With respect to starting the batch file whenever a USB drive is plugged in, you may refer to the article at https://tinyurl.com/ycg4a3p9
Hello Partha,
Thanks for your reply yesterday....not exactly what I was looking for though.
[attachment=3501]
I merely want to automate the Diskpart process when I have difficulty with a USB stick, particularly when it is not recognised.
Batch files will not do it on my PC, so I have moved on to Windows Powershell, a completely different animal.
The attachment shows the coding, basically I want to merge two small scripts, one formatting in FAT32 and the other in NTFS.
I am really looking for a Powershell solution where I can Input certain information, such as choosing the correct DiskNumber to format, either in FAT32 or NTFS, choose the DriveLetter, DriveLABEL.
Hello Brian
Thank you so much for posting another Youtube Video.
The Powershell one is now working.
I have left a small donation, but don't go wild, it's only a fiver!!!!