Jump to content

Recommended Posts

Posted (edited)

Here is what I want to do

I want to make an Executable with auto it that makes an exuctable for running a software from a server directory that can be downloaded on IIS

Situation:

Currently work for a company that installs the software on a central server drive

User then has to remember to make a shortcut link to their desktop

So i thought maybe i can get auto it to auto generate an exe for me(.lnk can not be downloaded)

 

the created .exe is really simple

Run(Location,Location3)

i ever have the a script that makes a .lnk now

DIM $sLocation =  ''
DIM $sLocation2 =  ''
Dim $iError =''




DIM $sLocation1 = 'B:\Content'
$sLocation1  = InputBox ( "Web Directory", "Where is the Content folder for web service located?" & @CRLF & @CRLF  &  "Must be Mapped drive of this computer",$sLocation1)


DIM $sLocation3 =  'W:\workstation'
$sLocation3  = InputBox ( "EXE folder", "Where is the workstation located?" ,$sLocation3)




$sLocation =  $sLocation3 & '\FileToRun.exe';
$sLocation2 = $sLocation1 & '\' & 'Desktop.lnk';


$iError = FileCreateShortcut($sLocation, $sLocation2,$sLocation3)
IF $iError = 1 Then
MsgBox(0,'Sucess', 'Desktop Shortcut created')
Else
MsgBox(0,'Failure', 'Report Imeditely')
endif

 

Am I missing something simple or have I thought of a problem without a simple solution

Edited by Tdurrant
Posted (edited)

Welcome to the forum.

Please read: How to post code on the forum

EDIT:

And before you post code please use TIDY

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Alas, it was tiddy before posting, but when i went to edit it it decided to screw the formating

#AutoIt3Wrapper_icon = bMobile.ico
Dim $sLocation = ''
Dim $sLocation2 = ''
Dim $iError = ''


Dim $sLocation1 = 'B:\Content'
$sLocation1 = InputBox("Web Directory", "Where is the Content folder for bmobile located?" & @CRLF & @CRLF & "Must be Mapped drive of this computer", $sLocation1)

Dim $sLocation3 = '\\192.168.10.50\Stuff\TestBuild\Promotimng USA B0908\Workstation'
$sLocation3 = InputBox("bMobile Worstationfolder", "Where is the bMobile workstation located?" & @CRLF & @CRLF & "Must be \\[IP ADRESS OF SERVER]\[Folder holding RouteManager.exe]", $sLocation3)


$sLocation = $sLocation3 & '\RouteManager.exe';
$sLocation2 = $sLocation1 & '\Desktop\' & 'bMobile Desktop';

$iError = FileCreateShortcut($sLocation, $sLocation2, $sLocation3)
If $iError = 1 Then
    MsgBox(0, 'Sucess', 'Desktop Shortcut created')
Else
    MsgBox(0, 'Failure', 'Report Imeditely')
EndIf

hopefully 

Posted

try to use this:

FileOpenDialog

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

I may being slow but I am not sure how that would help, so i may not being explaining my self well

 

Idea is to write a program in auto it that generates an exe that is only

RUN(Location,Location3)

to allow any one to generate an exe for the webervice instead of me making a new exe every time

Posted

If you run the shortcut-creating script from the network share containing the target executable, then @scriptdir will give you its location. You can then append the executable name to get $Location1/3 automatically.

@DesktopDir or @DesktopCommonDir macros give you the desktop location on the local computer for $Location2.

With these you should be able to write a script that can be launched at LAN logon and automatically creates the shortcut, no questions asked. 

BTW, if the need to do this arises because computers have varying and unpredictable drive mappings, then you really ought to think in terms of disallowing manual mapping of shares in Explorer via group policy, and use a server-side logon script to establish the mappings. With a unified environment you can reuse the same .lnk file for all desktops, no need to create it programmatically.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...