Click to See Complete Forum and Search --> : copy files(How to write batch file)


anandtugaon
October 10th, 2007, 02:16 AM
Hi,

I am using the xcopy comand copy the files,but my question is

1) i using below command,

xcopy c:\Sachin \*exe D:\Gilchrist\ /u /y

this command copy the all files which are already exists , but copy all files its took longer time

My question is i don't want copy the files which same modified date already exists in destination?

------------------------------------------------------------------------------------------------
Note:

xcopy c:\Sachin\*.exe D:\Gilchrist\ /d /y

this command copy the latest modified files
------------------------------------------------------------------------------------------------

Please suggest me How to write a batch file which copy the files those are different modified date?

Thanks,
Anand

dglienna
October 10th, 2007, 02:24 AM
/D copies the newest files. What do you want? That sounded like it.

anandtugaon
October 10th, 2007, 02:50 AM
Hi dglienna,


My question is


xcopy c:\Sachin\*.exe D:\Gilchrist\ /d /y

This command copy the latest files, but my question is

* In d:\ drive have the latest files but in source (c:\) have older files but this time i want copy the olderversion files. and also some time in source & destination have same modified date that time i won't copy those files
?


Please suggest me how can i write batch file?


Thanks,
Anand

PeejAvery
October 10th, 2007, 08:05 AM
Basically you are looking to sync the D:\ folder with the C:\ folder, but don't want to overwrite all the files because it takes longer.

No batch file can do this, but you can get dos software which does.

http://www.google.com/search?hl=en&q=synchronize+folder+in+dos&btnG=Search

anandtugaon
October 19th, 2007, 04:35 AM
Hi,


I have the one exe file in "c:\Forms10G\forms90\internet.exe", this file i want to

move GroupPloicy folder i.e

1)startup scripts
2)Shutdown scripts

Please tell me How can i write batch file which can move this file to group policy script folders?


Thanks,
Anand

PeejAvery
October 19th, 2007, 06:43 AM
It's just a simply xcopy command.

xcopy c:\Forms10G\forms90\internet.exe c:\path\to\startupscriptsfolder
xcopy c:\Forms10G\forms90\internet.exe c:\path\to\shutdownscriptsfolder

anandtugaon
October 21st, 2007, 11:40 PM
HI,

I am facing main problem is path, we can't find "c:\to\startupfolder" we are doing following steps manually,

1)run "gpedit.msc" command
2)click on windows settings
3)click startup and shutdown folder
3)browse the file and put into above folders(startup & shutdown).

so i want to this automatically (using batch file) ?

dglienna
October 21st, 2007, 11:58 PM
On my Pro box:


c:\windows\system32\GroupPolicy\Machine\Scripts\Startup


c:\windows\system32\GroupPolicy\Machine\Scripts\Shutdown

anandtugaon
October 22nd, 2007, 12:58 AM
HI,

I tried this path before itself(c:\WINDOWS\system32\GroupPolicy\Machine\Scripts) , But during startup and shutdown time my batch file is not running,

If i will go set these manually
1)Run gpedit.msc command
2)click on wnidows settings
3)Browse files into scrpits(startup and shutdown )


in these above steps its working fine.


Please tell me How can automate these steps?

OR

Is there any settings the path "c:\WINDOWS\system32\GroupPolicy\Machine\Scripts" so, the batch file should run?


Thanks,
Anand

dglienna
October 22nd, 2007, 01:07 AM
You need the last folder name, and need to do it for both startup and shutdown

anandtugaon
October 22nd, 2007, 01:26 AM
HI,


I called the my batch file in below Path,

"C:\WINDOWS\system32\GroupPolicy\Machine\Scripts\Shutdown\Upload.bat"


So my Upload.bat file is not running during shutdown time?


Is this path is correct?


If this not correct please tell me which path i should call ?


Thanks your time,


Regards,
Anand

dglienna
October 22nd, 2007, 01:30 AM
Don't you have to reboot after changing Group Policy settings? I seem to remember that from somewhere.

Also, being on a domain will make a difference.


What's in the upload.bat?

anandtugaon
October 22nd, 2007, 01:57 AM
Hi,


My upload.bat ia m runing oracle scripts,

it contains

"sqlplus QUOTE/QUOTE@quote.cisgi.com @ c:\forms10g\forms90\Pro_Spin_upload.sql"



I am running "Pro_Spin_upload.sql" oracle script.


You told, Do not do my system reboot?

But i want to do call that batch (Upload.bat) file during shutdown time?



Please tell me How can I proced?

Thanks,
Anand

PeejAvery
October 22nd, 2007, 07:39 AM
You told, Do not do my system reboot?
No, he said that you have to reboot for system changes to take place. However, with Windows XP, a simple logoff and logon will accomplish the same settings refresh.

anandtugaon
October 22nd, 2007, 11:08 PM
Hi,

I rebooted the my system but it is not working.


Till i did not get, Why the batch file not working "c:\WINDOWS\system32\GroupPolicy\Machine\Scripts\Shutdown" in this path?

I do not want to go "gpedit.msc" method,

Is there any alternative method?

Thanks,
Anand

PeejAvery
October 23rd, 2007, 06:58 AM
Wait a second, you are using a batch file AS the shutdown script? I thought you were using the batch file to copy the shutdown scripts to the folder.

A shutdown script must be in VBScript (.vbs) or JScript (.js).