Solved

Ensure all commands in batch file are executed?

Hi everyone,

I have a batch file that mounts a network storage location using:
pushd (storage_server_path)
and then executes a Python script in the directory on the network storage server.

I noticed that if I hit the 'X' in the top right corner to close the command prompt while the Python script is running, the network storage location stays mapped on my machine even though the batch file contains popd to unmap the drive after I am done. Is there a way to ensure that all commands in the batch file are executed even if the command prompt is closed? I really don't want to have multiple different shortcuts mapped to this drive.

Thanks!
3 answers Last reply Best Answer
More about ensure commands batch file executed
  1. Best answer
    I don't think that's possible. Closing the command prompt window forces any batch files or other programs running in it to terminate.
  2. Okay - I did some searching on Google and couldn't find anything.
    I decided to go ahead and trying executing the Python script but instead of pushd'ing to the directory, I just specified the full path to the script. This appears to work without any issues and removes the need the map/unmap the drive.
    Thanks!
  3. Best answer selected by nismo9132.
Ask a new question

Read More

Python Storage Command Prompt Servers Windows 7