Batch file crashes when double clicked, but passes from command prompt
- by devinb
I have a batch file that was crashing when executing from windows explorer. I opened a command prompt and navigated to the file, but when I executed it there it did not crash.
I identified the line that was crashing.
SET list =(Company.Framework^
Company.SharePoint.Lists.News^
Company.SharePoint.WebControls^
Company.SharePoint.WebParts.NewsList^
Company.SharePoint.WebParts.RedirectWebPart^
Company.SharePoint.WebParts.IFrameWebPart^
Company.SharePoint.WebParts.ItemRotatorWebPart^
Company.SharePoint.WebParts.InteractiveMapWebPart^
Company.SharePoint.WebParts.SiteMapWebPart^
Company.SharePoint.Branding.PrettyUnicorns)
::Do stuff
::Failure occurs here
FOR %%F in %list% DO (
::Doesn't matter what is in here
ECHO Woo!
)
Is any reason why a batch file would behave differently from Windows Explorer vs Command Prompt?