need a windows batch file

I want to run an application which requires a network drive to be mapped. and then the executable needs to be run. so i made a simple batch file like

net use Z: "\\computername\shared folder"

now this creates the network mapping, runs the application fine. but the command prompt windows is always open. I just need a batch file that creates the network mapping in the background and just runs the application. this batch file will be made available to users throuch Citrix. so need help in creating a batch file that will make a network mapping, run the .exe and does not keep the command prompt open. it does it transparnatly
Who is Participating?
oBdAConnect With a Mentor Commented:
Simply add a 'start ""' in front of the call to calc.exe (note the empty pair of quotes at the beginning):
start "" "%Systemroot%\system32\calc.exe"
Mark DamenERP System ManagerCommented:

You can use VBScript instead of a batch file to do these things.

Create a new file called login.vbs in notepad.  Ensure that notepad doesnt append .txt to the end by selecting "All Files" from the type whilst saving.

Paste these lines in:

Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "Z:" , "\\computername\share"

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "%windir%\notepad "

mgmohiuddinAuthor Commented:
thanks a lot. the batch file is working but the vb script is giving an error appreciate if you could just verift it once. line two char 1 error.
mgmohiuddinAuthor Commented:
Ok the VB script is giving an error if the network mapping is already there. for example i run the script for the first time, it runs fine. it opens the application and also maps the drive. the second time i run this script gives me an error as the mapping is already there. it needs to create a mapping only if it is not there already. so maybe just need to modify the vb script slightly. thanks
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.