# Windows Plex Server fails to run post-processing script. Appears to be due to Plex including script executable in path string

**URL:** <https://forums.plex.tv/t/windows-plex-server-fails-to-run-post-processing-script-appears-to-be-due-to-plex-including-script-executable-in-path-string/744167>\
**Category:** Live TV & DVR\
**Tags:** livetv-dvr, server-windows\
**Created:** [September 18, 2021, 10:02am UTC](https://forums.plex.tv/t/windows-plex-server-fails-to-run-post-processing-script-appears-to-be-due-to-plex-including-script-executable-in-path-string/744167 "2021-09-18T10:02:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ry15151515](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ry15151515/32/254148_2.png) [@ry15151515](https://forums.plex.tv/u/ry15151515)\
**Post date:** [September 18, 2021, 10:02am UTC](https://forums.plex.tv/t/windows-plex-server-fails-to-run-post-processing-script-appears-to-be-due-to-plex-including-script-executable-in-path-string/744167/1 "2021-09-18T10:02:02Z")

</div>

Plex fails to run any post-processing script on Windows Plex Server

Server Version#: 1.24.2.4973  
Player Version#: 1.33.0.2444-a220eae4

For windows servers the default directory for scripts is

C:\Users\[username]\AppData\Local\Plex Media Server\Scripts\

Plex fails to run any .bat script I throw in to this directory though. WIth plex just reporting the script failed to run with exit code 1.

debug output indicates plex is attempting throwing in the PWD above + script name + input file path name.

While that seems right, what does not seem right is the entire command is surrounded with quotation marks.

eg. “C:\Users\[Username]\AppData\Local\Plex Media Server\Scripts\transcode.bat” “X:\Path\to\.grab\tvShow.ts”

If I straight copy and paste that into command prompt it fails with a parse error.

If instead I run…  
C:\Users\[Username]\AppData\Local\ **“Plex Media Server”** \Scripts\transcode.bat “X:\Path\to.grab\tvShow.ts”

The command completes succesfully.

_Note that Windows Plex Server admins are **unable** to change the script directory whatsoever._

**Question**  
Why is the Windows Plex Server encapsulating the post-processing script **executable** with quotation marks?

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [September 18, 2021, 5:57pm UTC](https://forums.plex.tv/t/windows-plex-server-fails-to-run-post-processing-script-appears-to-be-due-to-plex-including-script-executable-in-path-string/744167/2 "2021-09-18T17:57:56Z")

</div>

Because the `[Username]` part of the path name can contain spaces.

---

<div class="post-metadata">

**Author:** ![ry15151515](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ry15151515/32/254148_2.png) [@ry15151515](https://forums.plex.tv/u/ry15151515)\
**Post date:** [September 20, 2021, 1:10am UTC](https://forums.plex.tv/t/windows-plex-server-fails-to-run-post-processing-script-appears-to-be-due-to-plex-including-script-executable-in-path-string/744167/3 "2021-09-20T01:10:05Z")

</div>

Yes, I get that. the following also will work

“C:\Users\[Username]\AppData\Local\Plex Media Server\Scripts\"transcode.bat

Everything in the path **except for the executable** can be a string. My question still stands.

Why is the Windows Plex Server encapsulating the post-processing script **executable** with quotation marks?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 19, 2021, 1:10am UTC](https://forums.plex.tv/t/windows-plex-server-fails-to-run-post-processing-script-appears-to-be-due-to-plex-including-script-executable-in-path-string/744167/4 "2021-12-19T01:10:11Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
