krovax Posted June 7, 2007 Share Posted June 7, 2007 Hi guys, I'm a total newb in scripting and I hae the following need:I want to use Winpe 2.0 to wipe hardrive with diskpart and have a log of that. I want my log file to have the serial number of the drive as file name.I know that there is no good way to get the serial number of HDD (IDE or SATA) so I am using a bar code reader.The script should pop a text box so I can scan the serial number on the hard drive and keep that value to name my log file. here is a script someone made from me but we are unable to find what it's not working:Dim ReponseDim AbsPath:AbsPath = Replace(WScript.ScriptFullName, WScript.ScriptName, "") ' This variable DOES have a trailing '\' Reponse = inputbox("write a value,Cancel or no value to exit the script","Diskpart")If Answer = "" Then Wscript.QuitEnd ifCall ExecuteProg(AbsPath & "diskpart ", Answer)Sub ExecuteProg(PathAndProgName, Var1)Set WshShell = WScript.CreateObject("WScript.Shell")WshShell.Run PathAndProgName & "/s diskpart.txt>z:\" & Var1 & ".txt"End sub(there was a bit of french in here so I tried to rename it to english)in my startnet.cmd there is a command to map a drive to a network share then I am running the vbs.The vbs is supposed to start diskpart, run the script, and redirect the output to the mapped drive and use the value as a log file name.Now when we execute the vbs dispart is running but it's not using the the clean all command that he is supposed to do and there is no log file created.Thx for your help and don't be shy to ask me question if there is something bizarre (english is my second language so I'm trying to be as clear as I can) Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now