Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Batch File


  • Please log in to reply
5 replies to this topic

#1 djmiiller

djmiiller

  • Members
  • 27 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Missouri
  • Local time:02:51 PM

Posted 09 September 2014 - 08:28 AM

Hello, I am trying to make a batch file that will run from my flash drive. I will be needing it to find which drive letter the flash drive is on. Then at some point I will want it also to auto run the setup I am creating. For right now I am just looking to make it run from off of my flash drive. Here is some of the script that I have done. It pops up with an error that says

Windows cannot access \\F:\Flash

Check the spelling of the name. Otherwise, there might be a problem with your network. To try to identify and resolve network problems, Click Diagnose.

 

 

Here is some of the script that I have done.

 

@ECHO OFF

 

ECHO Welcome to the Durham company's automatic software installation program
PING 127.0.0.1 -n 2 -w 10000 >nul

 

CLS

 

:MOCHASOFT
CLS

 
ECHO Installing MochaSoft TN5250 Emulator
START /wait \\F:\Flash Drive\setup\Programs\Mochasoft\INSTALL_Mochasoft.BAT
:MOCHASOFT_END

 

 

 

:NET_FRAMEWORK
CLS
 
ECHO Installing MochaSoft TN5250 Emulator.......COMPLETE
ECHO Installing Microsoft .Net Framework 4.0
START /wait \\F:\Flash Drive\setup\Programs\Microsoft .Net\INSTALL_Microsoft_dotNETv40.BAT
:NET_FRAMEWORK_END

 

 

 

 

:COCREATE_2D
CLS
 
ECHO Installing MochaSoft TN5250 Emulator.......COMPLETE
ECHO Installing Microsoft .Net Framework 4.0....COMPLETE
ECHO Installing CoCreate 2DAccess V18
START /wait \\F:\Flash Drive\setup\Programs\CoCreate\INSTALL_CoCreate_2DAccess_v18.BAT
:COCREATE_2D_END

 

 

 

 

:COCREATE_3D
CLS
 
ECHO Installing MochaSoft TN5250 Emulator.......COMPLETE
ECHO Installing Microsoft .Net Framework 4.0....COMPLETE
ECHO Installing CoCreate 2DAccess V18...........COMPLETE
ECHO INSTALLING CoCreate 3DAccess V17
START /wait \\F:\Flash Drive\setup\Programs\CoCreate\INSTALL_CoCreate_3DAccess_v17.BAT
:COCREATE_3D_END

 

 

 

 

:EDRAWINGS
CLS
 
ECHO Installing MochaSoft TN5250 Emulator.......COMPLETE
ECHO Installing Microsoft .Net Framework 4.0....COMPLETE
ECHO Installing CoCreate 2DAccess V18...........COMPLETE
ECHO Installing CoCreate 3DAccess V17...........COMPLETE
ECHO Installing eDrawings Viewer
START /wait \\F:\Flash Drive\setup\Programs\eDrawings\INSTALL_eDrawings_2010.BAT
:EDRAWINGS_END

 

 

Please let me know what you see wrong and what ever you can do to help would be greatly appreciated.

 

thanks

DJ



BC AdBot (Login to Remove)

 


m

#2 Sirawit

Sirawit

    Bleepin' Brony


  • Malware Response Team
  • 4,154 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Thailand
  • Local time:02:51 AM

Posted 09 September 2014 - 08:29 AM

Try put " " around your path like "\\F:\Flash Drive\setup\Programs\eDrawings\INSTALL_eDrawings_2010.BAT"

 

Thank you.


If I don't reply back to you in 2 days, feel free to send me a PM.

 

“You’re lying… just like you were lying to me before. You have to hate me. I’ve been the worst daughter in the world… you should hate me.”

“But I don’t, Nyx. Because, Nyx, I’m your mother, and a mother will always love her daughter, no matter what.” -Past sins by Pen stroke.


#3 djmiiller

djmiiller
  • Topic Starter

  • Members
  • 27 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Missouri
  • Local time:02:51 PM

Posted 09 September 2014 - 08:37 AM

Thanks you for such a quick reply Sirawit. That did help with the error not coming up. It still doesn't download the program but im going to keep looking at the code and seeing if there isn't something else wrong with it. Please let me know if you see anything else wrong with it.

 

Thanks

DJ



#4 Sirawit

Sirawit

    Bleepin' Brony


  • Malware Response Team
  • 4,154 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Thailand
  • Local time:02:51 AM

Posted 09 September 2014 - 08:49 AM

Good to know your error had gone.

 

I never use batch to communicate via network before, so I have no idea about that, but other people may answer as well so keep an eye on the topic.

 

Thank you.


If I don't reply back to you in 2 days, feel free to send me a PM.

 

“You’re lying… just like you were lying to me before. You have to hate me. I’ve been the worst daughter in the world… you should hate me.”

“But I don’t, Nyx. Because, Nyx, I’m your mother, and a mother will always love her daughter, no matter what.” -Past sins by Pen stroke.


#5 JohnnyJammer

JohnnyJammer

  • Members
  • 1,108 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:QLD Australia
  • Local time:05:51 AM

Posted 09 September 2014 - 06:04 PM

try this mate

@ECHO OFF
TITLE Software Installer
ECHO Welcome to the Durham company's automatic software installation program
ping -n 5 127.0.0.1 > %TMP%\null
CLS
::MOCHASOFT
CLS
ECHO Installing MochaSoft TN5250 Emulator
START /wait "%CD%\Flash Drive\setup\Programs\Mochasoft\INSTALL_Mochasoft.BAT"
::MOCHASOFT_END
::NET_FRAMEWORK
CLS
ECHO Installing MochaSoft TN5250 Emulator.......COMPLETE
ECHO Installing Microsoft .Net Framework 4.0
START /wait "%CD%\Flash Drive\setup\Programs\Microsoft .Net\INSTALL_Microsoft_dotNETv40.BAT"
:NET_FRAMEWORK_END
::COCREATE_2D
CLS
ECHO Installing MochaSoft TN5250 Emulator.......COMPLETE
ECHO Installing Microsoft .Net Framework 4.0....COMPLETE
ECHO Installing CoCreate 2DAccess V18
START /wait "%CD%\Flash Drive\setup\Programs\CoCreate\INSTALL_CoCreate_2DAccess_v18.BAT"
::COCREATE_2D_END
::COCREATE_3D
CLS
ECHO Installing MochaSoft TN5250 Emulator.......COMPLETE
ECHO Installing Microsoft .Net Framework 4.0....COMPLETE
ECHO Installing CoCreate 2DAccess V18...........COMPLETE
ECHO INSTALLING CoCreate 3DAccess V17
START /wait "%CD%\Flash Drive\setup\Programs\CoCreate\INSTALL_CoCreate_3DAccess_v17.BAT"
::COCREATE_3D_END
::EDRAWINGS
CLS
ECHO Installing MochaSoft TN5250 Emulator.......COMPLETE
ECHO Installing Microsoft .Net Framework 4.0....COMPLETE
ECHO Installing CoCreate 2DAccess V18...........COMPLETE
ECHO Installing CoCreate 3DAccess V17...........COMPLETE
ECHO Installing eDrawings Viewer
START /wait "%CD%\Flash Drive\setup\Programs\eDrawings\INSTALL_eDrawings_2010.BAT"
::EDRAWINGS_END
DEL %TMP%\null

 

Also you can set it up on a  webserver and use BitsAdmin (used for pulling windows updates) to download a file and install it.

I have a batch file around here someone that shows how to use bitsadmin to download mozilla firefox from the web and install it.



#6 JohnnyJammer

JohnnyJammer

  • Members
  • 1,108 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:QLD Australia
  • Local time:05:51 AM

Posted 09 September 2014 - 06:08 PM

Here you go, just edit this if you like to take out the /p after set. Just paste the url in or UNC path and it will run automatically.

@ECHO OFF
ECHO **********************************************
ECHO * SCRIPT USED TO DOWNLAOD FILES FROM HTTP    *
ECHO * SCRIPT BY JohnnyJammer                           *
ECHO **********************************************
ECHO ---------
ECHO URL for HTTP Downloads http://releases.mozilla.org/pub/mozilla.org/firefox/releases/18.0/win32/en-US/Firefox%20Setup%2018.0.exe
ECHO URL can aslo be UNC path \\somefqdm\shares\somefile.exe
SET /P URL=What is the URL to downlaod:
ECHO ---------
ECHO Save files location like this C:\MozillaFireFox18.exe
ECHO ---------
SET /P LOCATION=What is the location to save file:
ECHO ---------
SET /P JOBNAME=Whats this jobs name IE MozillaFirefox, we need this for a job status query.
ECHO ---------
ECHO Opening bitsadmin and savign file %LOCATION%
ECHO ---------
ECHO ........Opening BitsAdmin now!
bitsadmin /transfer %JOBNAME% /download /priority high %URL% %LOCATION%





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users