<left><form action="https://www.paypal.com/cgi-bin/webscr" method="post">If you are satisfied with my help, consider a donation. Thank you so much for your continued support! <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="Y4ZDLXGFS4F8Q"> <input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online."> <img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="0" height="0"> </form>
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!
03-23-2018, 05:33 PM (This post was last modified: 03-23-2018, 06:56 PM by Mike-m5.
Edit Reason: Word "to" omitted
)
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!!!
03-24-2018, 12:29 PM (This post was last modified: 03-24-2018, 12:41 PM by Mike-m5.)
(03-23-2018, 10:35 PM)Partha Wrote:
If you would like user interaction in the batch files, there's a nice article at https://www.robvanderwoude.com/userinput.php#NT; you may want to check that
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.
03-24-2018, 01:08 PM (This post was last modified: 03-24-2018, 01:09 PM by Britec.)
I did a video for you a while back
This one is a powershell way
<left><form action="https://www.paypal.com/cgi-bin/webscr" method="post">If you are satisfied with my help, consider a donation. Thank you so much for your continued support! <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="Y4ZDLXGFS4F8Q"> <input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online."> <img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="0" height="0"> </form>
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!!!!
<left><form action="https://www.paypal.com/cgi-bin/webscr" method="post">If you are satisfied with my help, consider a donation. Thank you so much for your continued support! <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="Y4ZDLXGFS4F8Q"> <input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online."> <img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="0" height="0"> </form>