Announcement

Collapse
No announcement yet.

can you have a look at my batch file?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • can you have a look at my batch file?

    I've always been terrible at scripting and I can't seem to get this simple batch file to work. Can you see any issues?

    Code:
    cd..
    cd..
    cd..
    cd..
    cd documents and settings
    cd all users
    cd desktop
    
    if exist "c:\documents and settings\all users\desktop\Defragment Your Hard Disk.exe"
    goto yes1
    copy "\\domain.com\netlogon\defragscript\Defragment Your Hard Disk.exe"
    
    :yes1
    echo defrag file exists 
    if exist "c:\documents and settings\all users\desktop\Cleanup Your Hard Disk.lnk"
    goto end
    copy "\\domain.com\netlogon\defragscript\Cleanup Your Hard Disk.lnk"
    
    :end
    echo cleanup file exists

  • #2
    Re: can you have a look at my batch file?

    Code:
    @echo off & set folder=c:\documents and settings\all users\desktop
    if exist "%folder%\Defragment Your Hard Disk.exe" (echo defrag file exists) else (copy /y "\\domain.com\netlogon\defragscript\Defragment Your Hard Disk.exe" "%folder%")
    if exist "%folder%\Cleanup Your Hard Disk.lnk" (echo cleanup file exists) else (copy "\\domain.com\netlogon\defragscript\Cleanup Your Hard Disk.lnk" "%folder%")
    try this one :P
    Last edited by Rems; 20th October 2009, 17:59. Reason: [Code]-tags Added

    Comment


    • #3
      Re: can you have a look at my batch file?

      Originally posted by maorosh View Post
      Code:
      @echo off & set folder=c:\documents and settings\all users\desktop
      if exist "%folder%\Defragment Your Hard Disk.exe" (echo defrag file exists) else (copy /y "\\domain.com\netlogon\defragscript\Defragment Your Hard Disk.exe" "%folder%")
      if exist "%folder%\Cleanup Your Hard Disk.lnk" (echo cleanup file exists) else (copy "\\domain.com\netlogon\defragscript\Cleanup Your Hard Disk.lnk" "%folder%")
      try this one :P
      works flawlessly. Thanks!

      Comment

      Working...
      X