It would be a big help if you would label the pin numbers and the type of op-amp you are using.
If that 9 V battery is intended to be a "split supply" then you need two of them: one to provide +9 V to the positive supply rail of the op-amp and one to provide -9 V to the negative supply rail of the op-amp.
However, the circuit "as drawn" should work, but probably not as you expect. With the potentiometer at its mid-point applying, +4.5 V to the non-inverting input of the first op-amp with respect to the negative terminal of the battery, the output of the first op-amp should be +4.5 V with respect to the negative terminal of the 9 V battery. The same applies to the second op-amp after the switch is closed to charge the sampling capacitor: its output should be +4.5 V with respect to the negative terminal of the 9 V battery.
As you move the wiper arm toward the positive end of the battery, the output should increase above +4.5 V with respect to the negative terminal of the battery. Similarly, as you move the wiper arm toward the negative end of the battery, the output should decrease below +4.5 V with respect to the negative terminal of the battery. Here's the rub: most op-amps cannot swing their outputs rail-to-rail, meaning the output cannot go fully positive to 9 V with respect to the negative terminal of the battery; nor can the output go fully to zero with respect to the negative terminal of the battery. If you want the output swing to include zero, then you need a negative supply rail for the op-amp.
This is most easily accomplished by adding another battery in series with the first one and designating their common connection as "ground" for your circuit. Your output would then be measured with respect to this "ground" connection. The 100 kΩ potentiometer remains connected between the positive and negative supply rails of the op-amps, but now it causes the outputs to swing both positive and negative with respect to your new "ground" connection.
The link that
@Harald Kapp provided should be read for alternative means of providing a "virtual ground" connection if you are unable or unwilling to add a second battery to your circuit.