How do I launch a debugging session of my app with the current Visual Studio runtime environment?

Before I normally debug my application in Visual Studio, I normally launch VS2013 with a script that sets a bunch of environment variables (like PATH for certain DLLs), and other crucial variables to the application. However, when I try to debug the same application in Visual Studio using Nsight, it won’t let me launch the executable I’m trying to debug in the same environment that I launched my visual studio in. I always get errors telling me about missing DLLs, which again is the purpose for me launching Vs2013 through my script and I can’t find anywhere that I can set any environment variables before I launching the application with Nsight.

Does anyone know how I can launch my application with the NSight GPU debugger in the current environment without having to set them on a user or system basis? I actually even just tried that and that doesn’t seem to work either. Also im doing local host debugging if that helps.

I’ve also asked this before, and people have told me to go to Nsight properties select Launch as External application then setting my path to the script. Tried this as well. Doesn’t allow you to launch scripts. Only executables.

Just to make sure your Nsight settings are correct. For example. I have an a.bat to launch b.exe inside. Then my Nsight User Settings should like this:
Launch external Program: c:\Windows\System32\cmd . exe
Application is a launcher is checked
Command lin arguments: /c d:\a.bat

With this settings, I can launch Nsight Graphics Debugger correctly on b.exe. You say Nsight doesn’t allow you to launch scripts, are you providing your script in Launch external program? Here should be the program to run your script.