I am writing a VBScript to create partitions on a W2K server and have ran into a problem that I can't get past. Any help would be greatly appreciated.
Everything was going great until it was time to automate the formating of the new partitions. My problem is answering "y" to the question "PROCEED WITH FORMAT Y/N?"
I tried using "WshShell.sendkeys " as in the following example but the key strokes do not reach the command window.
set WshShell = Wscript.CreateObject("WScript.Shell"
WshShell.Run"format d: /FS:NTFS /Q /V:",9
WshShell.sendkeys "y"
WshShell.sendkeys "{ENTER}"
I also tried reading the character "y" from an input file. This worked in the Batch File version but not in VBScript.
WshShell.Run("format e: /FS:NTFS /Q /V: <c:\entcss_disk_part\ans.txt"
,7, true
Everything was going great until it was time to automate the formating of the new partitions. My problem is answering "y" to the question "PROCEED WITH FORMAT Y/N?"
I tried using "WshShell.sendkeys " as in the following example but the key strokes do not reach the command window.
set WshShell = Wscript.CreateObject("WScript.Shell"
WshShell.Run"format d: /FS:NTFS /Q /V:",9
WshShell.sendkeys "y"
WshShell.sendkeys "{ENTER}"
I also tried reading the character "y" from an input file. This worked in the Batch File version but not in VBScript.
WshShell.Run("format e: /FS:NTFS /Q /V: <c:\entcss_disk_part\ans.txt"