Subst being a wigger

Emile van Sebille emile at fenx.com
Wed Aug 15 11:42:08 EDT 2001


I suspect you're somehow running into a built-in/external problem.  subst is
an external command and dir is a shell built-in.  I'd look into the start
command to address that, or look into net use as an alternate.  NT has (as
far as I know) always allowed remapping its shared folders to itself.
Here's some code that works for me that uses net use to direct output to a
selected printer:

osCommands = [('net use %s: /DELETE' % (printerDevice,)),
        ('net use %s: %s /PERSISTENT:YES' % (printerDevice, printerID)),
        ('copy %s %s:' % (outFile, printerDevice))]

batch = open(batFile, 'w')
for eachCommand in osCommands:
    batch.write("%s\n" % eachCommand)
batch.flush()
batch.close()
os.system(batFile)

HTH,

--

Emile van Sebille
emile at fenx.com

---------
"Scott Taylor" <foobarickknob at yahoo.com> wrote in message
news:5a140c6d.0108142136.6dc1cd2f at posting.google.com...
> Does anybody know why this works...
>
> os.system('dir')
>
> ... but this doesn't? ...
>
> os.system('subst x: c:\\winnt')
>
> The symptoms w/ the subst line is that the subst actually takes
> affect, but I get an hanging dos box laying about until I ctrl-C out
> of it.  Platform is w2k.
>
> Oh, and if anybody knows of a better way to do a subst, I'd sure like
> to hear about it.
>
> Thanx!
>
> Scott




More information about the Python-list mailing list