Click here to Skip to main content
15,851,395 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
list volum
select disk 0
create partition primary
select partition 1
format fs=ntfs label="windows" quick
assign letter=c

i need to write the script in python which will automated above category .

What I have tried:[^]

here execute listdisk() i am geting issue
how do i solve the issue
Updated 2-Feb-23 5:15am
Richard MacCutchan 2-Feb-23 7:49am    
You have not explained what the problem is with the above script.
HelpMewithCode 2-Feb-23 8:44am    
above script dont have any problem but i want to assign disk letter

I need same kind of code
when i try fetch list disk command i was getting error like "int cant split "
template = result.split("\n")[0] #line 57
please can you help me how to ressolve this
thank you
Richard MacCutchan 2-Feb-23 9:54am    
If you have a problem then please use the Improve question link above, and add complete details into your question.
Richard MacCutchan 2-Feb-23 10:18am    
Please do what I suggested in my previous reply. We need all information here in the question, not on other sites. If you found some code on the internet that does not work then you need to talk to the person who write it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900