mishalk
asked on
group policy scripts
hi
i have a file called tns.ora which i want to replace and keep the new tns.ora in in all users
c:/oranet. how can i do this using a script through group policy.
i have a file called tns.ora which i want to replace and keep the new tns.ora in in all users
c:/oranet. how can i do this using a script through group policy.
If the domain users have write permission to the folder in question, you can create a GPO logon script for the users, and paste this code into a new batch file -
xcopy /y "\\servername\folder\tns.o ra" "c:\oranet\tns.ora" >nul
Put this batch file reference as a logon script in -
GP MMC > User Configuration > Policies > Windows Settings > Scripts > Logon
Lee
xcopy /y "\\servername\folder\tns.o
Put this batch file reference as a logon script in -
GP MMC > User Configuration > Policies > Windows Settings > Scripts > Logon
Lee
Sorry, forgot you wanted to keep the existing file too!
rename c:\oranet\tns.ora tns.ora.old
xcopy /y "\\servername\folder\tns.o ra" "c:\oranet\tns.ora" >nul
Lee
rename c:\oranet\tns.ora tns.ora.old
xcopy /y "\\servername\folder\tns.o
Lee
ASKER
rename c:\orant\NET80\ADMIN\TNSNA MES.ORA TNSNAMES.ORA.old
xcopy /y "\\192.168.1.24\Oracle TNSname update\TNSNAMES.ORA" "c:\orant\NET80\ADMIN\TNSN AMES.ORA" >nul
this is the exact script and the location, what is happening is it is renaming the file but not copying to the folder, i tried running it manually ,but it is doing it
xcopy /y "\\192.168.1.24\Oracle TNSname update\TNSNAMES.ORA" "c:\orant\NET80\ADMIN\TNSN
this is the exact script and the location, what is happening is it is renaming the file but not copying to the folder, i tried running it manually ,but it is doing it
ASKER
sorry
but it is not doing it
but it is not doing it
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
after removing the /y and instead of xcopy , i used copy
Ren tns.ora tns.ora.old
Then use something like xcopy to copy the new version down.
XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
[/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U]
[/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/B]
[/EXCLUDE:file1[+file2][+f
Use the good ol' fashioned xcopy /? to get more detail.