
scook at elp
Jun 18, 2003, 10:41 PM
Post #1 of 4
(49 views)
Permalink
|
I'm writing a script which at some point will map to a list of servers. The program will be keeping a log of problems it encounters to be reviewed later. To map the drive, I am using: sDrive = ["B","F","G","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X" ,"Y","Z"] iIndex = 0 shellCmd = "" for s in sImage: # list of servers shellCmd = "map " + sDrive[iIndex] + ":=" + s iIndex=iIndex + 1 os.system(shellCmd) My question is this...Is there a way to capture the DOS error it would display if it had a problem mapping the server? I want to detect the exception if there is one and write it to the log file. I have tried using OSError, SystemError, and StandardError without success. I'm not necessarily looking for someone to write the code for me as much as pointing me in the right direction. Thanks,
|