Search found 12 matches

by LiveITA
13 Mar 2018 03:50
Forum: DOS Batch Forum
Topic: Split variable in 2 after the last dot
Replies: 4
Views: 4164

Re: Split variable in 2 after the last dot

perfect thanks. just wondering, why you added the last

Code: Select all

set var
? it has no purpose
by LiveITA
12 Mar 2018 20:19
Forum: DOS Batch Forum
Topic: Split variable in 2 after the last dot
Replies: 4
Views: 4164

Split variable in 2 after the last dot

I need to cut variables in two smaller variables after the last dot. For example the variable european.union will be vara=european and varb=union I use the following code to accomplish this purpose: for /f "tokens=1 delims=." %%a in ("%elvariato%") do set vara=%%a for /f "tokens=2 delims=." %%a in (...
by LiveITA
12 Mar 2018 19:41
Forum: DOS Batch Forum
Topic: How to create links in automatic?
Replies: 8
Views: 9136

Re: How to create links in automatic?

Solved: All the code in the for loop i tried to add always breaks so i made it like this: After the for loop exit the loop with the current variables: goto nextpart ) ) :nextpart then run the code that you need to run and be sure to invalidate the item you were working with. This way, once the loop ...
by LiveITA
12 Mar 2018 13:33
Forum: DOS Batch Forum
Topic: How to create links in automatic?
Replies: 8
Views: 9136

Re: How to create links in automatic?

Squashman wrote:
12 Mar 2018 13:26
Merged topics and deleted empty posts.
They should not be merged, they cover 2 diffrent arguments: one is about a vbs script, the other is about batch for loops reiteration
by LiveITA
12 Mar 2018 13:18
Forum: DOS Batch Forum
Topic: How to create links in automatic?
Replies: 8
Views: 9136

Re: How to create links in automatic?

WHAT ARE YOU DOING! Why did you remove all the comments in each of your posts in this thread. Now the thread makes absolutely no sense. Answers were uncomplete so i just changed the main post. There was no full answer, bu thanks to the partial i got to the full answer. Ain't better to find the answ...
by LiveITA
12 Mar 2018 12:21
Forum: DOS Batch Forum
Topic: How to create links in automatic?
Replies: 8
Views: 9136

Batch reitaration for multiple variables

I'm having some issues with my script. This script goal is to create a list of pdf and doc files of any USB and to create a link to each one on the desktop :start for /f "skip=2 delims=" %%i in ( '2^>nul wmic logicaldisk get caption^,description^,drivetype /format:csv' ) do for /f "tokens=2-4 delims...
by LiveITA
11 Mar 2018 19:20
Forum: DOS Batch Forum
Topic: How to create links in automatic?
Replies: 8
Views: 9136

How to create links in automatic?

Post results: to change a preexisting link use: Set Shell = CreateObject("WScript.Shell") Set link = Shell.CreateShortcut("pathto\linktomodify.lnk") link.IconLocation = "pathto\icons.dll,"& WScript.Arguments(1) link.Arguments = WScript.Arguments(0) link.Save Be sure to use the & for the icons!!! if ...
by LiveITA
28 Jan 2018 15:50
Forum: DOS Batch Forum
Topic: wmic logicaldisk gives word output for drivetype instead of number (batch)
Replies: 6
Views: 6621

Re: wmic logicaldisk gives word output for drivetype instead of number (batch)

Jusr wondering, will it work on an account without admin privileges?
by LiveITA
28 Jan 2018 13:30
Forum: DOS Batch Forum
Topic: wmic logicaldisk gives word output for drivetype instead of number (batch)
Replies: 6
Views: 6621

Re: wmic logicaldisk gives word output for drivetype instead of number (batch)

I'm not really good with batch, if i set delim=, after tokens it does not work. What can i do?
by LiveITA
28 Jan 2018 08:26
Forum: DOS Batch Forum
Topic: wmic logicaldisk gives word output for drivetype instead of number (batch)
Replies: 6
Views: 6621

wmic logicaldisk gives word output for drivetype instead of number (batch)

I need to do stuffs when a network disk is found. To do so i need to look for drivetype 4 using this batch. The problem is that on my computer the drivetype for the network disk is "rete" (that means network in italian). How can i force wmic to output the number instead of the word? for /F "usebackq...
by LiveITA
25 Jan 2018 14:44
Forum: DOS Batch Forum
Topic: Create a shortcut via batch file
Replies: 2
Views: 4416

Create a shortcut via batch file

Hi guys I'm making a batch to install a program I made but I'm having an hard time to create a shortcut. I want to autostart the program at boot and this mean to create a shortcut into the startup folder. The batch I need to autostart is: del *log.txt wscript.exe "%USERPROFILE%\AppData\Roaming\Micro...