After connecting go to settings>usb preferences>select file transfer
Or go to developer settings>default usb preferences>file transfer or
Restart phn or
Unistall usb drivers in pc and reboot
I think this would be enough
Could you clarify more what you are trying to achieve?
Enable File Transfer? Or have it "not charge" when connected to PC?
For File transfer, you may try the above steps by Prashanth
As to make it not charge when connected to PC, we do not support that.
It is normal for the phone to default to charging when plugged in. Otherwise you are exposing yourself to possible hackers if you enable computer transfer all the time.