[Batch] Help BAT info

Discussion in 'Scripting' started by Cool8818, Nov 30, 2010.

  1. Cool8818

    Cool8818 MDL Novice

    Jan 18, 2010
    18
    1
    0
    hi guys i want to copy from USB Stick when it plugged to pc at 11.00am

    usb folder is: E:\My music
    the destination is: C:\MP3

    i just create bat file like that:

    @Echo Off
    XCopy "E:\My music \*.mp3"

    but i can't to enter time who can help me?
     
  2. jlgager

    jlgager MDL Developer

    Oct 30, 2009
    365
    3,230
    10
    just set the file as a scheduled task in control panel for 11am daily and it should run fine.
     
  3. Cool8818

    Cool8818 MDL Novice

    Jan 18, 2010
    18
    1
    0
    thank you so much now my problem is how can i hide cmd window i want to hide windows cmd for this file:
    C:\wxxx\xp.bat
     
  4. veey

    veey MDL Novice

    Jan 17, 2011
    6
    0
    0
    Run the scheduled job under another account (e.g. System) or create a specific user.
     
  5. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    #5 timesurfer, Jan 19, 2011
    Last edited by a moderator: Apr 20, 2017
    I found this

    Code:
    Set WshShell = CreateObject("WScript.Shell")
    cmds=WshShell.RUN("C:\wxxx\xp.bat", 0, True)
    Set WshShell = Nothing
    Can any Guru's explain these in relation to the OP questions
     
  6. wulai

    wulai MDL Novice

    Mar 24, 2011
    5
    0
    0

    you should type the following text and save as a .vbs extention file. the put the .vbs flie in your scheduled task. may it help you ^_^
    CreateObject("Wscript.Shell").Run "xp.bat",0,True