Let $R$ be an associative ring, $I$ a nonzero ideal of $R$ and $\sigma, \tau$ two epimorphisms of $R$. An additive mapping $F: R\rightarrow R$ is called a generalized $(\sigma,\tau)$-derivation of $R$ if there exists a $(\sigma,\tau)$-derivation $d: R\rightarrow R$ such that $F(xy)=F(x)\sigma(y)+\tau(x)d(y)$ holds for all $x,y\in R$. The objective of the present paper is to study the following situations in prime and semiprime rings: (i) $[F(x), x]_{\sigma,\tau} = 0$, (ii) $F([x, y]) = 0$, (iii) $F(x \circ y) = 0$, (iv) $F([x, y]) = [x, y]_{\sigma,\tau}$, (v) $F(x \circ y) = (x \circ y)_{\sigma,\tau}$, (vi) $F(xy)-\sigma(xy) \in Z(R)$, (vii) $F(x)F(y) -\sigma(xy) \in Z(R)$ for all $x,y\in I$, when $F$ is a generalized $(\sigma,\tau)$-derivation of $R$.